From 103399984df7de2617ecd3c5b68ca304348484a1 Mon Sep 17 00:00:00 2001 From: Burt Bielicki Date: Wed, 4 May 2016 09:33:58 -0700 Subject: [PATCH] remove password as a required field --- .../azure/cli/command_modules/vm/mgmt/azuredeploy.json | 3 ++- .../command_modules/vm/mgmt/lib/models/deployment_vm.py | 6 +++--- .../vm/mgmt/lib/operations/vm_operations.py | 7 ++++--- .../vm/mgmt/nested_templates/vm_existing_sshkey.json | 1 - .../vm/mgmt/nested_templates/vm_none_sshkey.json | 1 - .../cli/command_modules/vm/mgmt/swagger_create_vm.json | 9 ++------- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json index aa2f99590..23825fd26 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json @@ -11,8 +11,9 @@ }, "adminPassword": { "type": "securestring", + "defaultValue": "" "metadata": { - "description": "Password for the Virtual Machine." + "description": "Password for the Virtual Machine. Required if SSH (Linux only) is not specified." } }, "adminUsername": { diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py index 0324236dc..cf86b695a 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py @@ -50,7 +50,8 @@ class DeploymentVM(Model): :param virtual_network_type: Whether to use an existing VNet or create a new one. :type virtual_network_type: str - :param admin_password: Password for the Virtual Machine. + :param admin_password: Password for the Virtual Machine. Required if SSH + (Linux only) is not specified. :type admin_password: str :param os_sku: The OS SKU to install. :type os_sku: str @@ -111,7 +112,6 @@ class DeploymentVM(Model): 'uri': {'required': True, 'constant': True}, '_artifacts_location': {'constant': True}, 'name': {'required': True}, - 'admin_password': {'required': True}, 'admin_username': {'required': True}, 'mode': {'required': True, 'constant': True}, } @@ -161,7 +161,7 @@ class DeploymentVM(Model): mode = "Incremental" - def __init__(self, name, admin_password, admin_username, content_version=None, storage_container_name=None, virtual_network_name=None, subnet_ip_address_prefix=None, private_ip_address_allocation=None, dns_name_for_public_ip=None, storage_account_type=None, os_disk_uri=None, virtual_network_type=None, os_sku=None, subnet_name=None, os_type=None, os_version=None, os_disk_name=None, ssh_key_path=None, os_offer=None, public_ip_address_allocation=None, authentication_type=None, storage_account_name=None, storage_redundancy_type=None, size=None, public_ip_address_type=None, virtual_network_ip_address_prefix=None, availability_set_id=None, ssh_key_value=None, location=None, os_publisher=None, availability_set_type=None, public_ip_address_name=None, dns_name_type=None): + def __init__(self, name, admin_username, content_version=None, storage_container_name=None, virtual_network_name=None, subnet_ip_address_prefix=None, private_ip_address_allocation=None, dns_name_for_public_ip=None, storage_account_type=None, os_disk_uri=None, virtual_network_type=None, admin_password=None, os_sku=None, subnet_name=None, os_type=None, os_version=None, os_disk_name=None, ssh_key_path=None, os_offer=None, public_ip_address_allocation=None, authentication_type=None, storage_account_name=None, storage_redundancy_type=None, size=None, public_ip_address_type=None, virtual_network_ip_address_prefix=None, availability_set_id=None, ssh_key_value=None, location=None, os_publisher=None, availability_set_type=None, public_ip_address_name=None, dns_name_type=None): self.content_version = content_version self.storage_container_name = storage_container_name self.virtual_network_name = virtual_network_name diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py index 08f5e15d5..090ab86dd 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py @@ -32,7 +32,7 @@ class VMOperations(object): self.config = config def create_or_update( - self, resource_group_name, deployment_name, name, admin_password, admin_username, content_version=None, storage_container_name=None, virtual_network_name=None, subnet_ip_address_prefix=None, private_ip_address_allocation=None, dns_name_for_public_ip=None, storage_account_type=None, os_disk_uri=None, virtual_network_type=None, os_sku=None, subnet_name=None, os_type=None, os_version=None, os_disk_name=None, ssh_key_path=None, os_offer=None, public_ip_address_allocation=None, authentication_type=None, storage_account_name=None, storage_redundancy_type=None, size=None, public_ip_address_type=None, virtual_network_ip_address_prefix=None, availability_set_id=None, ssh_key_value=None, location=None, os_publisher=None, availability_set_type=None, public_ip_address_name=None, dns_name_type=None, custom_headers={}, raw=False, **operation_config): + self, resource_group_name, deployment_name, name, admin_username, content_version=None, storage_container_name=None, virtual_network_name=None, subnet_ip_address_prefix=None, private_ip_address_allocation=None, dns_name_for_public_ip=None, storage_account_type=None, os_disk_uri=None, virtual_network_type=None, admin_password=None, os_sku=None, subnet_name=None, os_type=None, os_version=None, os_disk_name=None, ssh_key_path=None, os_offer=None, public_ip_address_allocation=None, authentication_type=None, storage_account_name=None, storage_redundancy_type=None, size=None, public_ip_address_type=None, virtual_network_ip_address_prefix=None, availability_set_id=None, ssh_key_value=None, location=None, os_publisher=None, availability_set_type=None, public_ip_address_name=None, dns_name_type=None, custom_headers={}, raw=False, **operation_config): """ Create or update a virtual machine. @@ -43,8 +43,6 @@ class VMOperations(object): :type deployment_name: str :param name: The VM resource name. :type name: str - :param admin_password: Password for the Virtual Machine. - :type admin_password: str :param admin_username: Username for the Virtual Machine. :type admin_username: str :param content_version: If included it must match the ContentVersion @@ -71,6 +69,9 @@ class VMOperations(object): :param virtual_network_type: Whether to use an existing VNet or create a new one. :type virtual_network_type: str + :param admin_password: Password for the Virtual Machine. Required if + SSH (Linux only) is not specified. + :type admin_password: str :param os_sku: The OS SKU to install. :type os_sku: str :param subnet_name: The subnet name. diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_existing_sshkey.json b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_existing_sshkey.json index 9c0b86a2a..4083af1a5 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_existing_sshkey.json +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_existing_sshkey.json @@ -90,7 +90,6 @@ "osProfile": { "computerName": "[variables('vmName')]", "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPassword')]", "linuxConfiguration": { "disablePasswordAuthentication": true, "ssh": { diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_none_sshkey.json b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_none_sshkey.json index 0c8910401..3d6558d5c 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_none_sshkey.json +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/nested_templates/vm_none_sshkey.json @@ -88,7 +88,6 @@ "osProfile": { "computerName": "[variables('vmName')]", "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPassword')]", "linuxConfiguration": { "disablePasswordAuthentication": true, "ssh": { diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json index 34f45ab76..feedfefd8 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json @@ -327,7 +327,6 @@ } }, "required": [ - "adminPassword", "adminUsername", "virtualMachineName" ] @@ -435,14 +434,10 @@ "properties": { "value": { "type": "string", - "description": "Password for the Virtual Machine.", + "description": "Password for the Virtual Machine. Required if SSH (Linux only) is not specified.", "x-ms-client-name": "adminPassword" } - }, - "required": [ - "value" - ] - + } }, "DeploymentParameter_osSKU": { "properties": {