Skip to content

Commit

Permalink
Adds cluster identifier for rackspace based deployments, part of #13
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrithr committed Jul 27, 2013
1 parent 83a6c25 commit ea2f3d4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/ankuscli/config_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ def cloud_validator(hash_to_validate)
exit 2
end
elsif cloud_platform == 'rackspace'
valid_credentials = { 'rackspace_username' => '',
valid_credentials = {
'rackspace_username' => '',
'rackspace_api_key' => '',
'rackspace_instance_type' => '',
'rackspace_ssh_key' => ''
}
'rackspace_ssh_key' => '',
'rackspace_cluster_identifier' => ''
}
unless cloud_credentials.keys.sort == valid_credentials.keys.sort
puts '[Error]:'.red + ' cloud_credentials is malformed/invalid, look sample cloud config for example'
exit 1
Expand All @@ -190,6 +192,13 @@ def cloud_validator(hash_to_validate)
exit 1
end
end
#validate cluster identifier
if cloud_credentials['rackspace_cluster_identifier'].length == 0
puts '[Debug]: rackspace_cluster_identifier is not set, using the default: \'ops\''
hash_to_validate['rackspace_cluster_identifier'] = 'ops'
else
hash_to_validate['rackspace_cluster_identifier'] = cloud_credentials['rackspace_cluster_identifier']
end
#validate connection
rackspace = Rackspace.new(cloud_credentials['rackspace_api_key'], cloud_credentials['rackspace_username'])
unless rackspace.valid_connection?(rackspace.create_connection)
Expand Down

0 comments on commit ea2f3d4

Please sign in to comment.