-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[ Microsoft.SCVMM ] Requesting vmmserver credentials until non-empty #4863
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,3 +26,8 @@ Release History | |||||
| * Force and retain flags in VM delete | ||||||
| * Generated SDK now requires updated version of azure-cli | ||||||
| * Long running PATCH operations | ||||||
|
|
||||||
| 0.1.5 | ||||||
| +++ | ||||||
| * Requesting VMMServer credentials from the user until they are empty. | ||||||
| * Removing default value for port. Asking for the input. If input is empty, setting port to 8100. | ||||||
|
||||||
| * Removing default value for port. Asking for the input. If input is empty, setting port to 8100. | |
| * [BREAKING CHANGE] Removing default value for port. Asking for the input. If input is empty, setting port to 8100. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,26 +88,43 @@ def connect_vmmserver( | |
| fqdn=None, | ||
| username=None, | ||
| password=None, | ||
| port=DEFAULT_VMMSERVER_PORT, | ||
| port=None, | ||
| tags=None, | ||
| no_wait=False, | ||
| ): | ||
|
|
||
| creds_ok = all(inp is not None for inp in [fqdn, username, password]) | ||
| creds_ok = all(inp is not None for inp in [fqdn, port, username, password]) | ||
| while not creds_ok: | ||
| creds = { | ||
| 'fqdn': fqdn, | ||
| 'port': port, | ||
| 'username': username, | ||
| 'password': password, | ||
| } | ||
| if fqdn is None: | ||
| while not creds['fqdn']: | ||
| print('Please provide vmmserver FQDN or IP address: ', end='') | ||
| creds['fqdn'] = input() | ||
| if username is None: | ||
| if not creds['fqdn']: | ||
| print('Parameter is required, please try again') | ||
| while not creds['port']: | ||
| print('Please provide vmmserver port (Default: 8100): ', end='') | ||
| try: | ||
| creds['port'] = input() | ||
| if not creds['port']: | ||
| creds['port'] = DEFAULT_VMMSERVER_PORT | ||
| creds['port'] = int(creds['port']) | ||
| except ValueError: | ||
| print('Port must be a number, please try again') | ||
| creds['port'] = None | ||
|
Comment on lines
+109
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the automation scenario, if the CLI script does not pass in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is in line with the expectations. We will add modify the command by adding the new param to our automation pipelines. |
||
| while not creds['username']: | ||
| print('Please provide vmmserver username: ', end='') | ||
| creds['username'] = input() | ||
| if password is None: | ||
| if not creds['username']: | ||
| print('Parameter is required, please try again') | ||
| while not creds['password']: | ||
| creds['password'] = getpass('Please provide vmmserver password: ') | ||
| if not creds['password']: | ||
| print('Parameter is required, please try again') | ||
| print('Confirm vmmserver details? [Y/n]: ', end='') | ||
| res = input().lower() | ||
| if res in ['y', '']: | ||
|
|
@@ -118,8 +135,9 @@ def connect_vmmserver( | |
| file=sys.stderr, | ||
| ) | ||
| continue | ||
| fqdn, username, password = ( | ||
| fqdn, port, username, password = ( | ||
| creds['fqdn'], | ||
| creds['port'], | ||
| creds['username'], | ||
| creds['password'], | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
|
|
||
| logger.warn("Wheel is not available, disabling bdist_wheel hook") | ||
|
|
||
| VERSION = '0.1.4' | ||
| VERSION = '0.1.5' | ||
|
|
||
| # The full list of classifiers is available at | ||
| # https://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
|
|
@@ -46,8 +46,7 @@ | |
| # TODO: Update author and email, if applicable | ||
| author='Microsoft Corporation', | ||
| author_email='[email protected]', | ||
| # TODO: consider pointing directly to your source code instead of the generic repo | ||
| url='https://github.com/Azure/azure-cli-extensions/tree/main/src/connectedvmware', | ||
| url='https://github.com/Azure/azure-cli-extensions/tree/main/src/scvmm', | ||
| long_description=README + '\n\n' + HISTORY, | ||
| license='MIT', | ||
| classifiers=CLASSIFIERS, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.