Skip to content

Instantly share code, notes, and snippets.

@n1zyy
Created May 10, 2012 16:31
Show Gist options
  • Save n1zyy/2654324 to your computer and use it in GitHub Desktop.
Save n1zyy/2654324 to your computer and use it in GitHub Desktop.
OpenStack CredentialDefinitions
# We'll need this a couple times, so grab it up front:
# find_by_name is case-sensitive, at least on PostgreSQL
p_type = ProviderType.find_by_name('Openstack')
# Create a Username credential definition
CredentialDefinition.create!({
:name => 'username',
:label => 'Username',
:input_type => 'text',
:provider_type => p_type
})
# Create one for Password
CredentialDefinition.create!({
:name => 'password',
:label => 'Password',
:input_type => 'password',
:provider_type => p_type
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment