Commit 877bdecf authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Add check for clustername when adding backend

parent 50629cd6
......@@ -86,6 +86,12 @@ class Command(BaseCommand):
self.stdout.write('Check passed.\n')
info = client.GetInfo()
info_name = info['name']
if info_name != clustername:
raise CommandError("Invalid clustername value. Please use the"
" Ganeti Cluster name: %s" % info_name)
# Create the new backend in database
backend = Backend.objects.create(clustername=clustername,
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