Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #43 from s-t-e-v-e-n-k/backport-trove-random-password

Backport trove random password
  • Loading branch information...
vuntz committed Sep 14, 2016
2 parents def9604 + 4a778b5 commit 932298f250365fed6963700870e52db3a7a32daa
@@ -11,6 +11,7 @@
"cinder_instance": "none",
"rabbitmq_instance": "none",
"volume_support": false,
"service_user": "trove",
"db": {
"password": "",
"user": "trove",
@@ -22,6 +23,7 @@
"trove": {
"crowbar-revision": 1,
"crowbar-applied": false,
"schema-revision": 2,
"element_states": {
"trove-server": [ "readying", "ready", "applying" ]
},
@@ -20,6 +20,8 @@
"swift_instance": { "type": "str", "required": true },
"rabbitmq_instance": { "type": "str", "required": true },
"volume_support": { "type": "bool", "required": true },
"service_user": { "type": "str", "required": true },
"service_password": { "type": "str" },
"db": {
"type": "map",
"required": true,
@@ -47,6 +49,7 @@
"crowbar-status": { "type": "str" },
"crowbar-failed": { "type": "str" },
"crowbar-queued": { "type": "bool" },
"schema-revision": { "type": "int" },
"element_states": {
"type": "map",
"mapping": {
@@ -1,12 +1,14 @@
def upgrade ta, td, a, d
a['trove']['db'] = {}
a['trove']['db']['password'] = nil
a['trove']['db']['user'] = 'trove'
a['trove']['db']['database'] = 'trove'
unless a.key? "db"
a["db"] = {}
a["db"]["password"] = nil
a["db"]["user"] = "trove"
a["db"]["database"] = "trove"
end
return a, d
end

def downgrade ta, td, a, d
a['trove'].delete 'db'
a.delete 'db'
return a, d
end
@@ -0,0 +1,16 @@
def upgrade(ta, td, a, d)
# Use a class variable, since migrations are run twice.
unless defined?(@@trove_service_password)
service = ServiceObject.new "fake-logger"
@@trove_service_password = service.random_password
end
a["service_user"] = ta["service_user"]
a["service_password"] = @@trove_service_password
return a, d
end

def downgrade(ta, td, a, d)
a.delete("service_user")
a.delete("service_password")
return a, d
end
@@ -45,6 +45,7 @@ def create_proposal
base["attributes"][@bc_name]["swift_instance"] = find_dep_proposal("swift", true)
base["attributes"][@bc_name]["rabbitmq_instance"] = find_dep_proposal("rabbitmq")
base["attributes"][@bc_name]["db"]["password"] = random_password
base["attributes"][@bc_name]["service_password"] = random_password

# assign a default node to the trove-server role
nodes = NodeObject.all

0 comments on commit 932298f

Please sign in to comment.
You can’t perform that action at this time.