From c404be64b168d32316282d65d8d4819827417a5d Mon Sep 17 00:00:00 2001 From: Rebecca Makar Date: Wed, 10 Jun 2020 12:21:13 -0400 Subject: [PATCH 1/2] Fix bug in ST create, fix documentation for ST --- src/HPCCache/HPCCache/ChangeLog.md | 1 + .../HPCCache/Commands/NewAzHpcStorageTarget.cs | 15 +++++++++++++-- .../HPCCache/Properties/Resources.Designer.cs | 9 +++++++++ src/HPCCache/HPCCache/Properties/Resources.resx | 3 +++ .../HPCCache/help/New-AzHpcCacheStorageTarget.md | 4 ++-- .../HPCCache/help/Set-AzHpcCacheStorageTarget.md | 4 ++-- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/HPCCache/HPCCache/ChangeLog.md b/src/HPCCache/HPCCache/ChangeLog.md index 839701ab9e13..137f44ea7239 100644 --- a/src/HPCCache/HPCCache/ChangeLog.md +++ b/src/HPCCache/HPCCache/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed bug for New-AzHpcCacheStorageTarget and help text. ## Version 0.1.0 * Preview of `Az.HPCCache` module diff --git a/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs b/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs index 8a164381947b..53f21e082d54 100644 --- a/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs +++ b/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs @@ -130,7 +130,18 @@ public override void ExecuteCmdlet() this.Name, () => { - this.storageTarget = this.CLFS.IsPresent ? this.CreateClfsStorageTargetParameters() : this.CreateNfsStorageTargetParameters(); + if (this.CLFS.IsPresent) + { + this.storageTarget = this.CreateClfsStorageTargetParameters(); + } + else if (this.NFS.IsPresent) + { + this.storageTarget = this.CreateNfsStorageTargetParameters(); + } + else + { + throw new Exception(string.Format(Resources.CLFSorNFS)); + } if (this.IsParameterBound(c => c.Junction)) { this.storageTarget.Junctions = new List(); @@ -170,7 +181,7 @@ private bool DoesStorageTargetExists() this.CacheName, this.Name); - throw new Exception(string.Format(Resources.UpgradeHpcCache, this.Name, this.CacheName)); + throw new Exception(string.Format(Resources.StorageTargetAlreadyExist, this.Name, this.CacheName)); } catch (CloudErrorException e) { diff --git a/src/HPCCache/HPCCache/Properties/Resources.Designer.cs b/src/HPCCache/HPCCache/Properties/Resources.Designer.cs index c64ef6aba0f2..23ef6c634698 100644 --- a/src/HPCCache/HPCCache/Properties/Resources.Designer.cs +++ b/src/HPCCache/HPCCache/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Need CLFS or NFS flag.. + /// + internal static string CLFSorNFS { + get { + return ResourceManager.GetString("CLFSorNFS", resourceCulture); + } + } + /// /// Looks up a localized string similar to Are you sure you want to create HPC cache storage target '{0}'?. /// diff --git a/src/HPCCache/HPCCache/Properties/Resources.resx b/src/HPCCache/HPCCache/Properties/Resources.resx index 165da598f94a..822b2ffc6532 100644 --- a/src/HPCCache/HPCCache/Properties/Resources.resx +++ b/src/HPCCache/HPCCache/Properties/Resources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Need CLFS or NFS flag. + Are you sure you want to create HPC cache storage target '{0}'? diff --git a/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md b/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md index 6f2c3bb797f2..0ab5cd220ee9 100644 --- a/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md +++ b/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md @@ -33,12 +33,12 @@ The **New-AzHpcCacheStorageTarget** cmdlet adds a Storage Target to Azure HPC Ca ### Example 1 ```powershell -PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -StorageContainerID "/subscriptions/testsub/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testdstorageaccount/blobServices/default/containers/testcontainer" -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) +PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -StorageContainerID "/subscriptions/testsub/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testdstorageaccount/blobServices/default/containers/testcontainer" -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) ``` ### Example 2 ```powershell -PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -UsageModel "READ_HEAVY_INFREQ" -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) +PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -UsageModel "READ_HEAVY_INFREQ" -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) ``` ## PARAMETERS diff --git a/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md b/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md index c63d7e6fa3fa..8436807a6f6f 100644 --- a/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md +++ b/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md @@ -33,12 +33,12 @@ The **Set-AzHpcCacheStorageTarget** cmdlet updates a Storage Target attached to ### Example 1 ```powershell -PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) +PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) ``` ### Example 2 ```powershell -PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/export"}) +PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/export"}) ``` ## PARAMETERS From 7fa65daf44c7f2feb640a135ee6d3cc9639a19f0 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 16 Jun 2020 10:20:48 +0800 Subject: [PATCH 2/2] Update ChangeLog.md --- src/HPCCache/HPCCache/ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HPCCache/HPCCache/ChangeLog.md b/src/HPCCache/HPCCache/ChangeLog.md index 137f44ea7239..c59adddb3efb 100644 --- a/src/HPCCache/HPCCache/ChangeLog.md +++ b/src/HPCCache/HPCCache/ChangeLog.md @@ -18,7 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release -* Fixed bug for New-AzHpcCacheStorageTarget and help text. +* Fixed bug for `New-AzHpcCacheStorageTarget` and help text. ## Version 0.1.0 * Preview of `Az.HPCCache` module