-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #485 from s-t-e-v-e-n-k/trove-random-password
Set the trove service password to random
- Loading branch information
Showing
4 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
chef/data_bags/crowbar/migrate/trove/101_add_service_details.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters