Skip to content

Commit b459f26

Browse files
Apply DefaultLocation
1 parent 5522206 commit b459f26

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/ResourceManager/Common/Commands.Common.Strategies/AsyncCmdletExtensions.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public static async Task<TModel> RunAsync<TModel>(
5454
// read current Azure state.
5555
var current = await config.GetStateAsync(client, asyncCmdlet.CancellationToken);
5656
// update location.
57-
parameters.Location = current.UpdateLocation(parameters.Location, config);
57+
parameters.Location =
58+
parameters.Location ?? current.GetLocation(config) ?? parameters.DefaultLocation;
5859
// update a DAG of configs.
5960
config = await parameters.CreateConfigAsync();
6061
// create a target.
@@ -77,11 +78,6 @@ public static async Task<TModel> RunAsync<TModel>(
7778
return newState.Get(config) ?? current.Get(config);
7879
}
7980

80-
static string UpdateLocation(
81-
this IState current, string location, IResourceConfig config)
82-
=> location ?? current.GetLocation(config) ?? "eastus";
83-
84-
8581
static string ToPowerShellString(object value)
8682
{
8783
if (value == null)

0 commit comments

Comments
 (0)