-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Updating az use call to azds cli #211
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e8e1d2b
Updating az use call to azds cli
saurabsa 78ae6f1
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa 4c26647
Fix indentation error
saurabsa ea16794
Merge branch 'saurabsa/DevSpacePreview1.5' of https://github.com/saur…
saurabsa 93c9c4b
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa d27503c
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa 69006b5
update
saurabsa 711efb7
Update
saurabsa 49f78da
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa 14932c2
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa f8f1cb2
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa 303e15f
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa 683f489
Merge branch 'master' into saurabsa/DevSpacePreview1.5
saurabsa 6540c04
CR: renaming the prompt variable
saurabsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,30 +37,17 @@ def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_na | |
|
||
azds_cli = _install_dev_spaces_cli(update) | ||
|
||
from subprocess import PIPE | ||
retCode = subprocess.call( | ||
[azds_cli, 'controller', 'select', '--name', cluster_name, '--resource-group', resource_group_name], | ||
stderr=PIPE) | ||
if retCode != 0: | ||
retCode = subprocess.call( | ||
[azds_cli, 'controller', 'create', '--target-name', cluster_name, '--target-resource-group', | ||
resource_group_name, '--name', cluster_name, '--resource-group', resource_group_name], | ||
universal_newlines=True) | ||
if retCode != 0: | ||
return | ||
|
||
if space_name is None: | ||
space_name = 'default' | ||
|
||
retCode = subprocess.call( | ||
[azds_cli, 'space', 'select', '--name', space_name], stderr=PIPE) | ||
if retCode == 0: | ||
return | ||
|
||
create_space_arguments = [azds_cli, 'space', 'create', '--name', space_name] | ||
use_command_arguments = [azds_cli, 'use', '--name', cluster_name, | ||
'--resource-group', resource_group_name] | ||
|
||
if space_name is not None: | ||
use_command_arguments.append('--space') | ||
use_command_arguments.append(space_name) | ||
|
||
if prompt: | ||
pass | ||
subprocess.call(create_space_arguments, universal_newlines=True) | ||
use_command_arguments.append('-y') | ||
subprocess.call( | ||
use_command_arguments, universal_newlines=True) | ||
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. One line this |
||
|
||
|
||
def ads_remove_dev_spaces(cluster_name, resource_group_name, prompt=False): | ||
|
@@ -78,8 +65,8 @@ def ads_remove_dev_spaces(cluster_name, resource_group_name, prompt=False): | |
|
||
azds_cli = _install_dev_spaces_cli(False) | ||
|
||
remove_command_arguments = [azds_cli, 'controller', 'delete', '--name', | ||
cluster_name, '--resource-group', resource_group_name] | ||
remove_command_arguments = [azds_cli, 'remove', '--name', cluster_name, | ||
'--resource-group', resource_group_name] | ||
if prompt: | ||
remove_command_arguments.append('-y') | ||
subprocess.call( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt is more of a "don't prompt for input" parameter right? might want to change the naming to something like
yes
.