Skip to content

Commit 930597c

Browse files
authored
[Compute] az sig image-definition create: Fix bug about default value of Security Type (#29246)
1 parent 7bb6389 commit 930597c

File tree

3 files changed

+562
-95
lines changed

3 files changed

+562
-95
lines changed

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4787,9 +4787,9 @@ def create_gallery_image(cmd, resource_group_name, gallery_name, gallery_image_n
47874787
feature_list.append(GalleryImageFeature(name=key, value=value))
47884788
except ValueError:
47894789
raise CLIError('usage error: --features KEY=VALUE [KEY=VALUE ...]')
4790-
if security_type is None:
4790+
if security_type is None and hyper_v_generation == 'V2':
47914791
feature_list.append(GalleryImageFeature(name='SecurityType', value='TrustedLaunchSupported'))
4792-
if features is None and cmd.cli_ctx.cloud.profile == 'latest':
4792+
if features is None and cmd.cli_ctx.cloud.profile == 'latest' and hyper_v_generation == 'V2':
47934793
feature_list = []
47944794
feature_list.append(GalleryImageFeature(name='SecurityType', value='TrustedLaunchSupported'))
47954795

0 commit comments

Comments
 (0)