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:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,4 +5,5 @@ bin
|
||||
.tox
|
||||
*.sw[nop]
|
||||
.idea
|
||||
*.pyc
|
||||
*.pyc
|
||||
func-results.json
|
||||
|
||||
2
Makefile
2
Makefile
@@ -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
|
||||
|
||||
|
||||
@@ -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
0
lib/__init__.py
Normal file
1183
lib/ceph/__init__.py
1183
lib/ceph/__init__.py
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
__author__ = 'chris'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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:
|
||||
@@ -20,7 +20,7 @@ from mock import (
|
||||
patch,
|
||||
)
|
||||
|
||||
from ceph.ceph import ceph_broker
|
||||
from ceph import ceph_broker
|
||||
|
||||
|
||||
class TestCephOps(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user