Clean up dependency chain

This includes a resync of charms_ceph to raise the directory one level
    The charms_ceph change that we're syncing in changes the
    name of the ceph.py file into the __init__.py file to remove the
    second level of namespacing

Change-Id: I0122752fa2882d98d47e14ac50bfa6d14a08a50c
This commit is contained in:
Chris MacNaughton
2016-08-11 08:31:28 -04:00
parent b127be5f89
commit 1287b0c9c6
9 changed files with 1198 additions and 1190 deletions

3
.gitignore vendored
View File

@@ -5,4 +5,5 @@ bin
.tox
*.sw[nop]
.idea
*.pyc
*.pyc
func-results.json

View File

@@ -25,7 +25,7 @@ ch-sync: bin/charm_helpers_sync.py
$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-hooks.yaml
$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-tests.yaml
git-sync: bin/git_sync.py
$(PYTHON) bin/git_sync.py -d lib/ceph -s https://github.com/CanonicalLtd/charms_ceph.git
$(PYTHON) bin/git_sync.py -d lib -s https://github.com/CanonicalLtd/charms_ceph.git
sync: git-sync ch-sync

View File

@@ -23,8 +23,8 @@ import uuid
import time
sys.path.append('lib')
from ceph.ceph import ceph
from ceph.ceph.ceph_broker import (
import ceph
from ceph.ceph_broker import (
process_requests
)

0
lib/__init__.py Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
__author__ = 'chris'

File diff suppressed because it is too large Load Diff

View File

@@ -22,10 +22,11 @@ from charmhelpers.core.hookenv import (
INFO,
ERROR,
)
from charmhelpers.contrib.storage.linux.ceph import (
from charmhelpers.contrib.storage.linux.ceph import (
create_erasure_profile,
delete_pool,
erasure_profile_exists,
get_osds,
pool_exists,
pool_set,
remove_pool_snapshot,
@@ -190,7 +191,14 @@ def handle_replicated_pool(request, service):
replicas = request.get('replicas')
quota = request.get('max-bytes')
weight = request.get('weight')
# Optional params
pg_num = request.get('pg_num')
if pg_num:
# Cap pg_num to max allowed just in case.
osds = get_osds(service)
if osds:
pg_num = min(pg_num, (len(osds) * 100 // replicas))
# Check for missing params
if pool_name is None or replicas is None:

View File

@@ -20,7 +20,7 @@ from mock import (
patch,
)
from ceph.ceph import ceph_broker
from ceph import ceph_broker
class TestCephOps(unittest.TestCase):