Update charm-helpers sync source to temporary ~openstack-charmers helper branch.
This commit is contained in:
parent
f6c4de0071
commit
2cb3e8a3e0
@ -1,4 +1,4 @@
|
|||||||
branch: lp:charm-helpers
|
branch: lp:~openstack-charmers/charm-helpers/to_upstream
|
||||||
destination: hooks/charmhelpers
|
destination: hooks/charmhelpers
|
||||||
include:
|
include:
|
||||||
- core
|
- core
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
import commands
|
import commands
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import time
|
||||||
|
|
||||||
from subprocess import (
|
from subprocess import (
|
||||||
check_call,
|
check_call,
|
||||||
@ -24,6 +25,7 @@ from charmhelpers.core.hookenv import (
|
|||||||
related_units,
|
related_units,
|
||||||
log,
|
log,
|
||||||
INFO,
|
INFO,
|
||||||
|
ERROR
|
||||||
)
|
)
|
||||||
|
|
||||||
from charmhelpers.core.host import (
|
from charmhelpers.core.host import (
|
||||||
@ -179,11 +181,22 @@ def filesystem_mounted(fs):
|
|||||||
return fs in [f for m, f in mounts()]
|
return fs in [f for m, f in mounts()]
|
||||||
|
|
||||||
|
|
||||||
def make_filesystem(blk_device, fstype='ext4'):
|
def make_filesystem(blk_device, fstype='ext4', timeout=10):
|
||||||
log('ceph: Formatting block device %s as filesystem %s.' %
|
count = 0
|
||||||
(blk_device, fstype), level=INFO)
|
e_noent = os.errno.ENOENT
|
||||||
cmd = ['mkfs', '-t', fstype, blk_device]
|
while not os.path.exists(blk_device):
|
||||||
check_call(cmd)
|
if count >= timeout:
|
||||||
|
log('ceph: gave up waiting on block device %s' % blk_device,
|
||||||
|
level=ERROR)
|
||||||
|
raise IOError(e_noent, os.strerror(e_noent), blk_device)
|
||||||
|
log('ceph: waiting for block device %s to appear' % blk_device,
|
||||||
|
level=INFO)
|
||||||
|
count += 1
|
||||||
|
time.sleep(1)
|
||||||
|
else:
|
||||||
|
log('ceph: Formatting block device %s as filesystem %s.' %
|
||||||
|
(blk_device, fstype), level=INFO)
|
||||||
|
check_call(['mkfs', '-t', fstype, blk_device])
|
||||||
|
|
||||||
|
|
||||||
def place_data_on_ceph(service, blk_device, data_src_dst, fstype='ext4'):
|
def place_data_on_ceph(service, blk_device, data_src_dst, fstype='ext4'):
|
||||||
|
@ -294,6 +294,7 @@ class ApacheSSLContext(OSContextGenerator):
|
|||||||
if ca_cert:
|
if ca_cert:
|
||||||
with open(CA_CERT_PATH, 'w') as ca_out:
|
with open(CA_CERT_PATH, 'w') as ca_out:
|
||||||
ca_out.write(b64decode(ca_cert))
|
ca_out.write(b64decode(ca_cert))
|
||||||
|
check_call(['update-ca-certificates'])
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
if isinstance(self.external_ports, basestring):
|
if isinstance(self.external_ports, basestring):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user