Add swift-hash via config for ha

This commit is contained in:
James Page 2013-02-27 17:04:55 +00:00
parent b5e6ec5fcd
commit 1ce68ef6b5
2 changed files with 7 additions and 0 deletions

View File

@ -106,6 +106,9 @@ options:
type: string
description: Keystone admin password
# HA configuration settings
swift-hash:
type: string
description: Hash to use across all swift-proxy servers - don't loose
vip:
type: string
description: "Virtual IP to use to front swift-proxy in ha configuration"

View File

@ -105,6 +105,10 @@ def get_swift_hash():
if os.path.isfile(SWIFT_HASH_FILE):
with open(SWIFT_HASH_FILE, 'r') as hashfile:
swift_hash = hashfile.read().strip()
elif utils.config_get('swift-hash'):
swift_hash = utils.config_get('swift-hash')
with open(SWIFT_HASH_FILE, 'w') as hashfile:
hashfile.write(swift_hash)
else:
cmd = ['od', '-t', 'x8', '-N', '8', '-A', 'n']
rand = open('/dev/random', 'r')