@@ -1952,11 +1952,8 @@ def validate_vmss_disk(cmd, namespace):
19521952 raise CLIError ('usage error: --disk EXIST_DISK --instance-id ID' )
19531953
19541954
1955- def _validate_gallery_image_reference (cmd , namespace ):
1956- from azure .cli .core .profiles import ResourceType
1957- is_validate = 'gallery_image_reference' in namespace and namespace .gallery_image_reference is not None \
1958- and cmd .supported_api_version (resource_type = ResourceType .MGMT_COMPUTE ,
1959- operation_group = 'disks' , min_api = '2022-03-02' )
1955+ def _validate_gallery_image_reference (namespace ):
1956+ is_validate = 'gallery_image_reference' in namespace and namespace .gallery_image_reference is not None
19601957 if not is_validate :
19611958 return
19621959
@@ -1985,7 +1982,7 @@ def process_disk_create_namespace(cmd, namespace):
19851982 from azure .core .exceptions import HttpResponseError
19861983 validate_tags (namespace )
19871984 validate_edge_zone (cmd , namespace )
1988- _validate_gallery_image_reference (cmd , namespace )
1985+ _validate_gallery_image_reference (namespace )
19891986 _validate_security_data_uri (namespace )
19901987 _validate_upload_type (cmd , namespace )
19911988 _validate_secure_vm_disk_encryption_set (namespace )
@@ -2028,12 +2025,6 @@ def _validate_upload_type(cmd, namespace):
20282025 namespace .upload_type = 'Upload'
20292026
20302027 if namespace .upload_type == 'UploadWithSecurityData' :
2031-
2032- if not cmd .supported_api_version (min_api = '2021-08-01' , operation_group = 'disks' ):
2033- raise ArgumentUsageError (
2034- "'UploadWithSecurityData' is not supported in the current profile. "
2035- "Please upgrade your profile with 'az cloud set --profile newerProfile' and try again" )
2036-
20372028 if not namespace .security_type :
20382029 raise RequiredArgumentMissingError (
20392030 "Please specify --security-type when the value of --upload-type is 'UploadWithSecurityData'" )
@@ -2069,7 +2060,7 @@ def process_snapshot_create_namespace(cmd, namespace):
20692060 from azure .core .exceptions import HttpResponseError
20702061 validate_tags (namespace )
20712062 validate_edge_zone (cmd , namespace )
2072- _validate_gallery_image_reference (cmd , namespace )
2063+ _validate_gallery_image_reference (namespace )
20732064 if namespace .source :
20742065 usage_error = 'usage error: --source {SNAPSHOT | DISK} | --source VHD_BLOB_URI [--source-storage-account-id ID]'
20752066 try :
0 commit comments