@@ -61,11 +61,6 @@ public StorageAdminService(IOptions<StorageServiceConfiguration> options, ILogge
61
61
_accessKey = options . Value . Settings [ ConfigurationKeys . AccessKey ] ;
62
62
_secretKey = options . Value . Settings [ ConfigurationKeys . AccessToken ] ;
63
63
64
- SetCommandTemplates ( options ) ;
65
- }
66
-
67
- private void SetCommandTemplates ( IOptions < StorageServiceConfiguration > options )
68
- {
69
64
_set_connection_cmd = $ "alias set { _serviceName } http://{ _endpoint } { _accessKey } { _secretKey } ";
70
65
_get_connections_cmd = "alias list" ;
71
66
_get_users_cmd = $ "admin user list { _serviceName } ";
@@ -105,7 +100,7 @@ public async Task<bool> SetPolicyAsync(IdentityType policyType, List<string> pol
105
100
var setPolicyCmd = string . Format ( CultureInfo . InvariantCulture , _set_policy_cmd , _serviceName , policiesStr , policyType . ToString ( ) . ToLowerInvariant ( ) , itemName ) ;
106
101
var result = await ExecuteAsync ( setPolicyCmd ) . ConfigureAwait ( false ) ;
107
102
108
- var expectedResult = $ "Policy ` { policiesStr } ` is set on { policyType . ToString ( ) . ToLower ( ) } ` { itemName } ` ";
103
+ var expectedResult = $ "Attached Policies: [ { policiesStr } ] ";
109
104
if ( ! result . Any ( r => r . Contains ( expectedResult ) ) )
110
105
{
111
106
return false ;
@@ -274,7 +269,7 @@ private async Task<string> CreatePolicyAsync(PolicyRequest[] policyRequests, str
274
269
275
270
var policyFileName = await CreatePolicyFile ( policyRequests , username ) . ConfigureAwait ( false ) ;
276
271
var result = await ExecuteAsync ( string . Format ( CultureInfo . InvariantCulture , _create_policy_cmd , _serviceName , username , policyFileName ) ) . ConfigureAwait ( false ) ;
277
- if ( result . Any ( r => r . Contains ( $ "Added policy `pol_{ username } ` successfully.") ) is false )
272
+ if ( result . Any ( r => r . Contains ( $ "Created policy `pol_{ username } ` successfully.") ) is false )
278
273
{
279
274
await RemoveUserAsync ( username ) . ConfigureAwait ( false ) ;
280
275
File . Delete ( $ "{ username } .json") ;
0 commit comments