Commit e931c409 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Purge services for a given component

Provide option `--purge-services' in command component-modify.
One can always use service-import to register the services again.
parent 9b0953d5
......@@ -56,6 +56,11 @@ class Command(BaseCommand):
dest='renew_token',
default=False,
help="Renew component auth token"),
make_option('--purge-services',
action='store_true',
dest='purge_services',
default=False,
help="Purge all services registered for this component"),
)
def handle(self, *args, **options):
......@@ -77,6 +82,7 @@ class Command(BaseCommand):
url = options.get('url')
auth_token = options.get('auth_token')
renew_token = options.get('renew_token')
purge_services = options.get('purge_services')
if url:
component.url = url
......@@ -89,6 +95,9 @@ class Command(BaseCommand):
component.save()
if purge_services:
component.service_set.all().delete()
if renew_token:
self.stdout.write(
'Component\'s new token: %s\n' % component.auth_token
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment