From c73067bf5b8d304837c9c3b22086867a8653ed6d Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 11 Jul 2016 08:47:10 +0000 Subject: [PATCH] Add missing docstrings and move pep8 to run in python3 venv --- requirements.txt | 1 - src/lib/charm/openstack/designate_bind.py | 9 +++++++++ tox.ini | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 39e3263..93e7b1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ # Requirements to build the charm -charm-tools ruamel.yaml==0.10.12 simplejson flake8 diff --git a/src/lib/charm/openstack/designate_bind.py b/src/lib/charm/openstack/designate_bind.py index 7cffee9..29a506b 100644 --- a/src/lib/charm/openstack/designate_bind.py +++ b/src/lib/charm/openstack/designate_bind.py @@ -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() diff --git a/tox.ini b/tox.ini index 615ecfc..913c681 100644 --- a/tox.ini +++ b/tox.ini @@ -25,6 +25,7 @@ commands = commands = {posargs} [testenv:pep8] +basepython = python3.5 commands = flake8 {posargs} src/reactive src/lib unit_tests [testenv:py27]