Skip to content

Commit b4a9671

Browse files
iakov-awsIakov Gan
andauthored
fix error with share-with-account (#324)
* fix error with share-with-account Co-authored-by: Iakov Gan <[email protected]>
1 parent ca17c64 commit b4a9671

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cid/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ def deploy(self, dashboard_id: str=None, recursive=True, update=False, **kwargs)
313313

314314
_url = self.qs_url.format(dashboard_id=dashboard_id, **self.qs_url_params)
315315

316-
if self.qs.dashboards.get(dashboard_id):
316+
dashboard = self.qs.dashboards.get(dashboard_id)
317+
if isinstance(dashboard, Dashboard):
317318
if update:
318319
return self.update_dashboard(dashboard_id)
319320
else:
@@ -322,7 +323,7 @@ def deploy(self, dashboard_id: str=None, recursive=True, update=False, **kwargs)
322323

323324
print(f'Deploying dashboard {dashboard_id}')
324325
try:
325-
self.qs.create_dashboard(dashboard_definition, **kwargs)
326+
dashboard = self.qs.create_dashboard(dashboard_definition, **kwargs)
326327
print(f"\n#######\n####### Congratulations!\n####### {dashboard_definition.get('name')} is available at: {_url}\n#######")
327328
self.track('created', dashboard_id)
328329
except self.qs.client.exceptions.ResourceExistsException:
@@ -338,7 +339,7 @@ def deploy(self, dashboard_id: str=None, recursive=True, update=False, **kwargs)
338339
param_name=f'share-with-account',
339340
message=f'Share this dashboard with everyone in the account?',
340341
choices=['yes', 'no'],
341-
default='yes') != 'yes':
342+
default='yes') == 'yes':
342343
permissions_tpl = Template(resource_string(
343344
package_or_requirement='cid.builtin.core',
344345
resource_name=f'data/permissions/dashboard_link_permissions.json',

0 commit comments

Comments
 (0)