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

[Core] Update core for latest knack #8940

Merged
merged 2 commits into from Apr 2, 2019
Merged

[Core] Update core for latest knack #8940

merged 2 commits into from Apr 2, 2019

Conversation

tjprescott
Copy link
Member

Knack now contains the configure_defaults logic. This moves the CLI toward relying on that implmentation.


This checklist is used to make sure that common guidelines for a pull request are followed.

  • [N/A] The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@@ -10,6 +10,7 @@
from azure.cli.core.profiles import ResourceType

from knack.log import get_logger
from knack.validators import DefaultStr, DefaultInt # pylint: disable=unused-import
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid the breaking change to core that would occur if these were removed.

overrides.settings['default'] = DefaultStr(config_value)
overrides.settings['required'] = False
# same blunt mechanism like we handled id-parts, for create command, no name default
if self.name.split()[-1] == 'create' and overrides.settings.get('metavar', None) == 'NAME':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we ignore defaults for create commands previously?

Copy link
Contributor

@adewaleo adewaleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -11,4 +11,3 @@
CONFIG_FILE_NAME = 'config'
GLOBAL_CONFIG_PATH = os.path.join(GLOBAL_CONFIG_DIR, CONFIG_FILE_NAME)
ENV_VAR_PREFIX = 'AZURE'
DEFAULTS_SECTION = 'defaults'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is a "breaking change" but I suppose it can't be helped.

@@ -59,7 +59,7 @@
'colorama>=0.3.9',
'humanfriendly>=4.7',
'jmespath',
'knack>=0.5.3',
'knack>=0.5.4',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're at it, should we use the ~= operator instead of the >= operator? Especially when libraries are in the 0 band, we want to protect ourselves from breaking changes (even if we're the ones who would be doing it.)

@tjprescott tjprescott merged commit be84df6 into Azure:dev Apr 2, 2019
@tjprescott tjprescott deleted the KnackUpdate branch April 2, 2019 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants