Add missing docstrings and move pep8 to run in python3 venv

This commit is contained in:
Liam Young 2016-07-11 08:47:10 +00:00
parent bbbd9e8d10
commit c73067bf5b
3 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,4 @@
# Requirements to build the charm
charm-tools
ruamel.yaml==0.10.12
simplejson
flake8

View File

@ -312,13 +312,22 @@ class DesignateBindCharm(openstack_charm.OpenStackCharm):
subprocess.check_call(cmd, cwd=ZONE_DIR)
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)
try:
os.mkdir(sync_dir, 0o755)
except FileExistsError:
os.chmod(sync_dir, 0o755)
return sync_dir
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('/', '_')
touch_file = '{}/juju-zone-src-{}'.format(ZONE_DIR, unit_name)
open(touch_file, 'w+').close()

View File

@ -25,6 +25,7 @@ commands =
commands = {posargs}
[testenv:pep8]
basepython = python3.5
commands = flake8 {posargs} src/reactive src/lib unit_tests
[testenv:py27]