[sparkiegeek,r=james-page] Refactoring to support use of library code from hooks and actions.
This change moves a number of pieces from out of the hooks directory including: swift_storage* other than actual hooks charmhelpers so that they can be re-used from actions and hooks more easily.
This commit is contained in:
commit
317a2ca3af
@ -4,4 +4,4 @@ exclude_lines =
|
||||
if __name__ == .__main__.:
|
||||
include=
|
||||
hooks/swift_storage_*
|
||||
|
||||
lib/swift_storage_*
|
||||
|
5
Makefile
Normal file → Executable file
5
Makefile
Normal file → Executable file
@ -2,8 +2,9 @@
|
||||
PYTHON := /usr/bin/env python
|
||||
|
||||
lint:
|
||||
@flake8 --exclude hooks/charmhelpers hooks
|
||||
@flake8 --exclude hooks/charmhelpers unit_tests tests
|
||||
@flake8 lib
|
||||
@flake8 hooks
|
||||
@flake8 unit_tests tests
|
||||
@charm proof
|
||||
|
||||
unit_test:
|
||||
|
@ -1,5 +1,5 @@
|
||||
branch: lp:charm-helpers
|
||||
destination: hooks/charmhelpers
|
||||
destination: charmhelpers
|
||||
include:
|
||||
- core
|
||||
- cli
|
||||
|
1
hooks/charmhelpers
Symbolic link
1
hooks/charmhelpers
Symbolic link
@ -0,0 +1 @@
|
||||
../charmhelpers/
|
@ -3,7 +3,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from swift_storage_utils import (
|
||||
from lib.swift_storage_utils import (
|
||||
PACKAGES,
|
||||
RESTART_MAP,
|
||||
SWIFT_SVCS,
|
||||
|
0
lib/__init__.py
Normal file
0
lib/__init__.py
Normal file
@ -1,6 +1,6 @@
|
||||
[nosesetests]
|
||||
[nosetests]
|
||||
verbosity=2
|
||||
with-coverage=1
|
||||
cover-erase=1
|
||||
cover-package=hooks
|
||||
cover-package=lib,hooks.swift_storage_hooks
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
import sys
|
||||
sys.path.append('hooks')
|
@ -1,7 +1,7 @@
|
||||
from mock import MagicMock
|
||||
from test_utils import CharmTestCase, patch_open
|
||||
|
||||
import swift_storage_context as swift_context
|
||||
import lib.swift_storage_context as swift_context
|
||||
|
||||
|
||||
TO_PATCH = [
|
||||
|
@ -2,16 +2,16 @@ from mock import patch, MagicMock
|
||||
|
||||
from test_utils import CharmTestCase, patch_open
|
||||
|
||||
import swift_storage_utils as utils
|
||||
import lib.swift_storage_utils as utils
|
||||
|
||||
_reg = utils.register_configs
|
||||
utils.register_configs = MagicMock()
|
||||
|
||||
import swift_storage_hooks as hooks
|
||||
import hooks.swift_storage_hooks as hooks
|
||||
|
||||
utils.register_configs = _reg
|
||||
|
||||
from swift_storage_utils import PACKAGES
|
||||
from lib.swift_storage_utils import PACKAGES
|
||||
|
||||
TO_PATCH = [
|
||||
'CONFIGS',
|
||||
|
@ -4,7 +4,7 @@ import tempfile
|
||||
from mock import call, patch, MagicMock
|
||||
from test_utils import CharmTestCase, patch_open
|
||||
|
||||
import swift_storage_utils as swift_utils
|
||||
import lib.swift_storage_utils as swift_utils
|
||||
|
||||
|
||||
TO_PATCH = [
|
||||
|
Loading…
Reference in New Issue
Block a user