Add missing docstrings and move pep8 to run in python3 venv
This commit is contained in:
parent
bbbd9e8d10
commit
c73067bf5b
|
@ -1,5 +1,4 @@
|
||||||
# Requirements to build the charm
|
# Requirements to build the charm
|
||||||
charm-tools
|
|
||||||
ruamel.yaml==0.10.12
|
ruamel.yaml==0.10.12
|
||||||
simplejson
|
simplejson
|
||||||
flake8
|
flake8
|
||||||
|
|
|
@ -312,13 +312,22 @@ class DesignateBindCharm(openstack_charm.OpenStackCharm):
|
||||||
subprocess.check_call(cmd, cwd=ZONE_DIR)
|
subprocess.check_call(cmd, cwd=ZONE_DIR)
|
||||||
|
|
||||||
def setup_sync_dir(self, sync_time):
|
def setup_sync_dir(self, sync_time):
|
||||||
|
"""Create directory to store zone sync files
|
||||||
|
|
||||||
|
:returns: None
|
||||||
|
"""
|
||||||
sync_dir = '{}/zone-syncs'.format(WWW_DIR, sync_time)
|
sync_dir = '{}/zone-syncs'.format(WWW_DIR, sync_time)
|
||||||
try:
|
try:
|
||||||
os.mkdir(sync_dir, 0o755)
|
os.mkdir(sync_dir, 0o755)
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
os.chmod(sync_dir, 0o755)
|
os.chmod(sync_dir, 0o755)
|
||||||
|
return sync_dir
|
||||||
|
|
||||||
def create_sync_src_info_file(self):
|
def create_sync_src_info_file(self):
|
||||||
|
"""Touch a file which indicates where this sync file came from
|
||||||
|
|
||||||
|
:returns: None
|
||||||
|
"""
|
||||||
unit_name = hookenv.local_unit().replace('/', '_')
|
unit_name = hookenv.local_unit().replace('/', '_')
|
||||||
touch_file = '{}/juju-zone-src-{}'.format(ZONE_DIR, unit_name)
|
touch_file = '{}/juju-zone-src-{}'.format(ZONE_DIR, unit_name)
|
||||||
open(touch_file, 'w+').close()
|
open(touch_file, 'w+').close()
|
||||||
|
|
Loading…
Reference in New Issue