diff --git a/senlinclient/v1/models.py b/senlinclient/v1/models.py index d550cbd5..736cab3f 100644 --- a/senlinclient/v1/models.py +++ b/senlinclient/v1/models.py @@ -80,6 +80,7 @@ class ProfileTypeTemplate(resource.Resource): class Profile(resource.Resource): + resource_key = 'profile' resources_key = 'profiles' base_path = '/profiles' service = clustering_service.ClusteringService() diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index 363afa66..a95c0635 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -144,9 +144,12 @@ def do_profile_show(sc, args): ['name', 'rollback', 'parameters', 'environment', 'template'], ['property', 'value']), } + print(profile.to_dict()) utils.print_dict(profile.to_dict(), formatters=formatters) +@utils.arg('-f', '--force', default=False, action="store_true", + help=_('Delete the profile completely from database.')) @utils.arg('id', metavar='', nargs='+', help=_('Name or ID of profile(s) to delete.')) def do_profile_delete(sc, args): @@ -155,7 +158,10 @@ def do_profile_delete(sc, args): for cid in args.id: try: - query = {'id': cid} + query = { + 'id': cid, + 'force': args.force + } sc.delete(models.Profile, query) except exc.HTTPNotFound as ex: failure_count += 1