forked from ceph/calamari
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
274 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Name: tendrl-ceph-integration | ||
Version: 1.4.1 | ||
Version: 1.4.2 | ||
Release: 1%{?dist} | ||
BuildArch: noarch | ||
Summary: Tendrl bridge for Ceph Storage | ||
|
@@ -60,6 +60,9 @@ py.test -v tendrl/ceph_integration/tests || : | |
%{_sysconfdir}/tendrl/ceph-integration/ceph-integration.conf.yaml | ||
|
||
%changelog | ||
* Mon Jun 19 2017 Rohan Kanade <[email protected]> - 1.4.2-1 | ||
- Release tendrl-ceph-integration v1.4.2 | ||
|
||
* Thu Jun 08 2017 Rohan Kanade <[email protected]> - 1.4.1-1 | ||
- Release tendrl-ceph-integration v1.4.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tendrl/ceph_integration/objects/ecprofile/atoms/check_ec_profile_available/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import etcd | ||
import gevent | ||
|
||
from tendrl.commons.event import Event | ||
from tendrl.commons.message import Message | ||
from tendrl.commons import objects | ||
from tendrl.commons.objects import AtomExecutionFailedError | ||
|
||
|
||
class CheckECProfileAvailable(objects.BaseAtom): | ||
def __init__(self, *args, **kwargs): | ||
super(CheckECProfileAvailable, self).__init__(*args, **kwargs) | ||
|
||
def run(self): | ||
retry_count = 0 | ||
while True: | ||
try: | ||
NS.ceph.objects.ECProfile( | ||
name=self.parameters['ECProfile.name'] | ||
).load() | ||
return True | ||
except etcd.EtcdKeyNotFound: | ||
retry_count += 1 | ||
gevent.sleep(1) | ||
if retry_count == 600: | ||
Event( | ||
Message( | ||
priority="error", | ||
publisher=NS.publisher_id, | ||
payload={ | ||
"message": "ECProfile %s not reflected in tendrl yet. Timing out" % | ||
self.parameters['ECProfile.name'] | ||
}, | ||
job_id=self.parameters['job_id'], | ||
flow_id=self.parameters['flow_id'], | ||
cluster_id=NS.tendrl_context.integration_id, | ||
) | ||
) | ||
raise AtomExecutionFailedError( | ||
"ECProfile %s not reflected in tendrl yet. Timing out" % | ||
self.parameters['ECProfile.name'] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
from tendrl.commons import objects | ||
from tendrl.integrations.ceph.objects import osd | ||
|
||
|
||
class Osd(objects.BaseObject): | ||
class Osd(osd.Osd): | ||
def __init__(self, id=None, | ||
uuid=None, public_addr=None, cluster_addr=None, | ||
heartbeat_front_addr=None, heartbeat_back_addr=None, | ||
uuid=None, hostname=None, public_addr=None, cluster_addr=None, | ||
device_path=None, heartbeat_front_addr=None, heartbeat_back_addr=None, | ||
down_at=None, up_from=None, lost_at=None, | ||
osd_up=None, osd_in=None, up_thru=None, | ||
weight=None, primary_affinity=None, | ||
state=None, last_clean_begin=None, | ||
last_clean_end=None, *args, **kwargs): | ||
super(Osd, self).__init__(*args, **kwargs) | ||
|
||
self.id = id | ||
self.uuid = uuid | ||
self.public_addr = public_addr | ||
self.cluster_addr = cluster_addr | ||
self.heartbeat_front_addr = heartbeat_front_addr | ||
self.heartbeat_back_addr = heartbeat_back_addr | ||
self.down_at = down_at | ||
self.up_from = up_from | ||
self.lost_at = lost_at | ||
self.osd_up = osd_up | ||
self.osd_in = osd_in | ||
self.up_thru = up_thru | ||
self.weight = weight | ||
self.primary_affinity = primary_affinity | ||
self.state = state | ||
self.last_clean_begin = last_clean_begin | ||
self.last_clean_end = last_clean_end | ||
self.value = 'clusters/{0}/Osds/{1}' | ||
|
||
def render(self): | ||
self.value = self.value.format( | ||
NS.tendrl_context.integration_id, | ||
self.uuid | ||
last_clean_end=None, total=None, used=None, used_pcnt=None, | ||
*args, **kwargs): | ||
super(Osd, self).__init__( | ||
id=id, | ||
uuid=uuid, | ||
hostname=hostname, | ||
public_addr=public_addr, | ||
cluster_addr=cluster_addr, | ||
device_path=device_path, | ||
heartbeat_front_addr=heartbeat_front_addr, | ||
heartbeat_back_addr=heartbeat_back_addr, | ||
down_at=down_at, | ||
up_from=up_from, | ||
lost_at=lost_at, | ||
osd_up=osd_up, | ||
osd_in=osd_in, | ||
up_thru=up_thru, | ||
weight=weight, | ||
primary_affinity=primary_affinity, | ||
state=state, | ||
last_clean_begin=last_clean_begin, | ||
last_clean_end=last_clean_end, | ||
total=total, | ||
used=used, | ||
used_pcnt=used_pcnt, | ||
*args, | ||
**kwargs | ||
) | ||
return super(Osd, self).render() |
54 changes: 54 additions & 0 deletions
54
tendrl/ceph_integration/objects/pool/atoms/check_pool_available/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import etcd | ||
import gevent | ||
|
||
from tendrl.ceph_integration.objects.pool import Pool | ||
from tendrl.commons.event import Event | ||
from tendrl.commons.message import Message | ||
from tendrl.commons import objects | ||
from tendrl.commons.objects import AtomExecutionFailedError | ||
|
||
|
||
class CheckPoolAvailable(objects.BaseAtom): | ||
def __init__(self, *args, **kwargs): | ||
super(CheckPoolAvailable, self).__init__(*args, **kwargs) | ||
|
||
def run(self): | ||
retry_count = 0 | ||
while True: | ||
pools = None | ||
try: | ||
pools = NS._int.client.read( | ||
"clusters/%s/Pools" % NS.tendrl_context.integration_id | ||
) | ||
except etcd.EtcdKeyNotFound: | ||
pass | ||
|
||
if pools: | ||
for entry in pools.leaves: | ||
try: | ||
pool = Pool(pool_id=entry.key.split("Pools/")[-1]).load() | ||
if pool.pool_name == self.parameters['Pool.poolname']: | ||
return True | ||
except etcd.EtcdKeyNotFound: | ||
continue | ||
|
||
retry_count += 1 | ||
gevent.sleep(1) | ||
if retry_count == 600: | ||
Event( | ||
Message( | ||
priority="error", | ||
publisher=NS.publisher_id, | ||
payload={ | ||
"message": "Pool %s not reflected in tendrl yet. Timing out" % | ||
self.parameters['Pool.pool_name'] | ||
}, | ||
job_id=self.parameters['job_id'], | ||
flow_id=self.parameters['flow_id'], | ||
cluster_id=NS.tendrl_context.integration_id, | ||
) | ||
) | ||
raise AtomExecutionFailedError( | ||
"Pool %s not reflected in tendrl yet. Timing out" % | ||
self.parameters['Pool.pool_name'] | ||
) |
43 changes: 43 additions & 0 deletions
43
tendrl/ceph_integration/objects/rbd/atoms/check_rbd_available/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import etcd | ||
import gevent | ||
|
||
from tendrl.commons.event import Event | ||
from tendrl.commons.message import Message | ||
from tendrl.commons import objects | ||
from tendrl.commons.objects import AtomExecutionFailedError | ||
|
||
|
||
class CheckRbdAvailable(objects.BaseAtom): | ||
def __init__(self, *args, **kwargs): | ||
super(CheckRbdAvailable, self).__init__(*args, **kwargs) | ||
|
||
def run(self): | ||
retry_count = 0 | ||
while True: | ||
try: | ||
NS.ceph.objects.Rbd( | ||
pool_id=self.parameters['Rbd.pool_id'], | ||
name=self.parameters['Rbd.name'] | ||
).load() | ||
return True | ||
except etcd.EtcdKeyNotFound: | ||
retry_count += 1 | ||
gevent.sleep(1) | ||
if retry_count == 600: | ||
Event( | ||
Message( | ||
priority="error", | ||
publisher=NS.publisher_id, | ||
payload={ | ||
"message": "Rbd %s not reflected in tendrl yet. Timing out" % | ||
self.parameters['Rbd.name'] | ||
}, | ||
job_id=self.parameters['job_id'], | ||
flow_id=self.parameters['flow_id'], | ||
cluster_id=NS.tendrl_context.integration_id, | ||
) | ||
) | ||
raise AtomExecutionFailedError( | ||
"Rbd %s not reflected in tendrl yet. Timing out" % | ||
self.parameters['Rbd.name'] | ||
) |
Oops, something went wrong.