Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Base Profile Warning for Python SDK but not Zowe CLI #327

Open
dkelosky opened this issue Aug 29, 2024 · 2 comments
Open

Missing Base Profile Warning for Python SDK but not Zowe CLI #327

dkelosky opened this issue Aug 29, 2024 · 2 comments
Labels
bug Something isn't working priority-low severity-low

Comments

@dkelosky
Copy link

If you create a zowe.config.json like this (with valid values for host/user/passwor):

{
    "$schema": "./zowe.schema.json",
    "profiles": {
        "sys1": {
            "type": "zosmf",
            "properties": {
                "port": 1443,
                "host": "sys1.mainframe.net",
                "user": "ibmuser",
                "password": "ibmpass"
            },
            "secure": []
        }
    },
    "defaults": {
        "zosmf": "sys1"
    },
    "autoStore": true
}

Then run python code such as:

from zowe.zos_jobs_for_zowe_sdk import Jobs
from zowe.core_for_zowe_sdk import ProfileManager

profile = ProfileManager().load(profile_type="zosmf")
jobs = Jobs(profile)
jobs_list = jobs.list_jobs()

for job in jobs_list:
    print(f"jobid: {job.jobid} is: {job.status}")

You get a warning like ProfileParsingWarning: "Given profile type 'base' has no default profile name" warnings.warn(

However, this same profile does not produce a warning for Zowe CLI. As a workaround you can add:

        "base": {
            "type": "base"
        }

And:

    "defaults": {
        "zosmf": "sys1",
        "base": "base"
    },
@dkelosky dkelosky added the bug Something isn't working label Aug 29, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Aug 29, 2024
@adam-wolfe
Copy link

Suggestion: Move the warning to the log rather than outputting it to the terminal.

@zowe-robot zowe-robot moved this from New Issues to Low Priority in Zowe CLI Squad Sep 4, 2024
@dkelosky
Copy link
Author

dkelosky commented Sep 5, 2024

That suggestion is good; however, this config presents no warning for the CLI so I think the behavior is inconsistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-low severity-low
Projects
Status: Low Priority
Development

No branches or pull requests

2 participants