@@ -61,7 +61,7 @@ def describe_environment(self, name):
61
61
# Describe will fail in certain fault scenarios early in Environment creation
62
62
# We helpfully provide the summary listing as a backup set of information
63
63
# If the environment truly does not exist, then this will give the same response
64
- self .sdk .throw_warning (CdpWarning (resp .violations ))
64
+ self .sdk .throw_warning (CdpWarning (str ( resp .violations ) ))
65
65
return self .summarize_environment (name )
66
66
self .sdk .throw_error (resp )
67
67
return resp
@@ -105,9 +105,9 @@ def create_aws_environment(self, **kwargs):
105
105
)
106
106
if isinstance (resp , CdpError ):
107
107
if resp .error_code == 'INVALID_ARGUMENT' :
108
- if 'constraintViolations' not in resp .violations :
109
- resp .update (message = "Received violation warning:\n %s" % self .sdk .dumps (resp .violations ))
110
- self .sdk .throw_warning (CdpWarning (resp .violations ))
108
+ if 'constraintViolations' not in str ( resp .violations ) :
109
+ resp .update (message = "Received violation warning:\n %s" % self .sdk .dumps (str ( resp .violations ) ))
110
+ self .sdk .throw_warning (CdpWarning (str ( resp .violations ) ))
111
111
self .sdk .throw_error (resp )
112
112
return resp
113
113
@@ -119,9 +119,9 @@ def create_azure_environment(self, **kwargs):
119
119
)
120
120
if isinstance (resp , CdpError ):
121
121
if resp .error_code == 'INVALID_ARGUMENT' :
122
- if 'constraintViolations' not in resp .violations :
123
- resp .update (message = "Received violation warning:\n %s" % self .sdk .dumps (resp .violations ))
124
- self .sdk .throw_warning (CdpWarning (resp .violations ))
122
+ if 'constraintViolations' not in str ( resp .violations ) :
123
+ resp .update (message = "Received violation warning:\n %s" % self .sdk .dumps (str ( resp .violations ) ))
124
+ self .sdk .throw_warning (CdpWarning (str ( resp .violations ) ))
125
125
self .sdk .throw_error (resp )
126
126
return resp
127
127
@@ -133,9 +133,9 @@ def create_gcp_environment(self, **kwargs):
133
133
)
134
134
if isinstance (resp , CdpError ):
135
135
if resp .error_code == 'INVALID_ARGUMENT' :
136
- if 'constraintViolations' not in resp .violations :
137
- resp .update (message = "Received violation warning:\n %s" % self .sdk .dumps (resp .violations ))
138
- self .sdk .throw_warning (CdpWarning (resp .violations ))
136
+ if 'constraintViolations' not in str ( resp .violations ) :
137
+ resp .update (message = "Received violation warning:\n %s" % self .sdk .dumps (str ( resp .violations ) ))
138
+ self .sdk .throw_warning (CdpWarning (str ( resp .violations ) ))
139
139
self .sdk .throw_error (resp )
140
140
return resp
141
141
@@ -205,7 +205,7 @@ def sync_users(self, environments=None):
205
205
)
206
206
if isinstance (resp , CdpError ):
207
207
if resp .error_code == 'CONFLICT' :
208
- operation_match = self .sdk .regex_search (self .sdk .OPERATION_REGEX , resp .violations )
208
+ operation_match = self .sdk .regex_search (self .sdk .OPERATION_REGEX , str ( resp .violations ) )
209
209
if operation_match is not None :
210
210
existing_op_id = operation_match .group (1 )
211
211
if not self .sdk .strict_errors :
@@ -264,11 +264,11 @@ def create_aws_credential(self, name, role, description, retries=3, delay=2):
264
264
consistency_violations = [
265
265
'Unable to verify credential' , 'sts:AssumeRole' , 'You are not authorized'
266
266
]
267
- if any (x in resp .violations for x in consistency_violations ):
267
+ if any (x in str ( resp .violations ) for x in consistency_violations ):
268
268
retries = retries - 1
269
269
self .sdk .throw_warning (
270
270
CdpWarning ('Got likely AWS IAM eventual consistency error [%s], %d retries left...'
271
- % (resp .violations , retries ))
271
+ % (str ( resp .violations ) , retries ))
272
272
)
273
273
self .sdk .sleep (delay )
274
274
return self .create_aws_credential (name , role , description , retries , delay )
0 commit comments