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

Support nested team config files #135

Closed
Tracked by #148
t1m0thyj opened this issue Sep 9, 2022 · 1 comment · Fixed by #144
Closed
Tracked by #148

Support nested team config files #135

t1m0thyj opened this issue Sep 9, 2022 · 1 comment · Fixed by #144
Labels
enhancement New feature or request priority-high

Comments

@t1m0thyj
Copy link
Member

t1m0thyj commented Sep 9, 2022

Currently only top-level profiles get loaded. We should support a zosmf child profile with a typeless parent profile like the following:

{
    "$schema": "./zowe.schema.json",
    "profiles": {
        "lpar1": {
            "profiles": {
                "zosmf": {
                    "type": "zosmf",
                    "properties": {
                        "port": 443
                    },
                    "secure": []
                }
            },
            "properties": {
                "host": "example.com",
                "rejectUnauthorized": true
            },
            "secure": [
                "user",
                "password"
            ]
        }
    },
    "defaults": {
        "zosmf": "lpar1.zosmf"
    },
    "autoStore": true
}
@t1m0thyj t1m0thyj added this to the Zowe v2 Team Configuration milestone Sep 9, 2022
@t1m0thyj
Copy link
Member Author

t1m0thyj commented Dec 5, 2022

Currently, we support loading "flat level" profiles like the following:

{
    "$schema": "./zowe.schema.json",
    "profiles": {
        "lpar1_zosmf": {
            "properties": {
                "host": "example.com",
                "port": 443,
                "rejectUnauthorized": true
            },
            "secure": [
                "user",
                "password"
            ]
        }
    },
    "defaults": {
        "zosmf": "lpar1_zosmf"
    },
    "autoStore": true
}
from zowe.core_for_zowe_sdk import ProfileManager
profile_manager = ProfileManager(show_warnings=False)
print(profile_manager.load(profile_type="lpar1_zosmf"))

This will print the host, port, and rejectUnauthorized properties for the "lpar1_zosmf" profile.

The example config JSON at the top of the page uses nested profiles to store properties separately at the top level ("lpar1") and in a sub-profile ("lpar1.zosmf").
We want to support the following:

from zowe.core_for_zowe_sdk import ProfileManager
profile_manager = ProfileManager(show_warnings=False)
print(profile_manager.load(profile_type="lpar1.zosmf"))  # Note the "." indicating a nested profile

Currently this fails. Instead we want it to load host and rejectUnauthorized from the "lpar1" profile, and port from the "lpar1.zosmf" profile, and print them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants