Add swift-hash via config for ha
This commit is contained in:
parent
b5e6ec5fcd
commit
1ce68ef6b5
|
@ -106,6 +106,9 @@ options:
|
||||||
type: string
|
type: string
|
||||||
description: Keystone admin password
|
description: Keystone admin password
|
||||||
# HA configuration settings
|
# HA configuration settings
|
||||||
|
swift-hash:
|
||||||
|
type: string
|
||||||
|
description: Hash to use across all swift-proxy servers - don't loose
|
||||||
vip:
|
vip:
|
||||||
type: string
|
type: string
|
||||||
description: "Virtual IP to use to front swift-proxy in ha configuration"
|
description: "Virtual IP to use to front swift-proxy in ha configuration"
|
||||||
|
|
|
@ -105,6 +105,10 @@ def get_swift_hash():
|
||||||
if os.path.isfile(SWIFT_HASH_FILE):
|
if os.path.isfile(SWIFT_HASH_FILE):
|
||||||
with open(SWIFT_HASH_FILE, 'r') as hashfile:
|
with open(SWIFT_HASH_FILE, 'r') as hashfile:
|
||||||
swift_hash = hashfile.read().strip()
|
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:
|
else:
|
||||||
cmd = ['od', '-t', 'x8', '-N', '8', '-A', 'n']
|
cmd = ['od', '-t', 'x8', '-N', '8', '-A', 'n']
|
||||||
rand = open('/dev/random', 'r')
|
rand = open('/dev/random', 'r')
|
||||||
|
|
Loading…
Reference in New Issue