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

Updating az use call to azds cli #211

Merged
merged 14 commits into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 12 additions & 25 deletions src/dev-spaces-preview/azext_dev_spaces_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

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.

pass
subprocess.call(create_space_arguments, universal_newlines=True)
use_command_arguments.append('-y')
subprocess.call(
use_command_arguments, universal_newlines=True)
Copy link
Contributor

Choose a reason for hiding this comment

The 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):
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/dev-spaces-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from setuptools import setup, find_packages

VERSION = "0.1.4"
VERSION = "0.1.5"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down
8 changes: 4 additions & 4 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@
],
"dev-spaces-preview": [
{
"filename": "dev_spaces_preview-0.1.4-py2.py3-none-any.whl",
"sha256Digest": "cd2d50ea8a3a46a4b86d3a8810341b05205b91d87b8e9e5c26e7536714bad7ff",
"downloadUrl": "https://azuredevspacestools.blob.core.windows.net/azdssetup/LKS/dev_spaces_preview-0.1.4-py2.py3-none-any.whl",
"filename": "dev_spaces_preview-0.1.5-py2.py3-none-any.whl",
"sha256Digest": "28077ae576f5a86dca30f7def0308d3a26d7464f91f82109c1dc8fc4b11c6a6f",
"downloadUrl": "https://azuredevspacestools.blob.core.windows.net/azdssetup/LKS/dev_spaces_preview-0.1.5-py2.py3-none-any.whl",
"metadata": {
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.0.32",
Expand Down Expand Up @@ -411,7 +411,7 @@
"metadata_version": "2.0",
"name": "dev-spaces-preview",
"summary": "Dev Spaces provides a rapid, iterative Kubernetes development experience for teams.",
"version": "0.1.4"
"version": "0.1.5"
}
}
],
Expand Down