-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jan-Marten Brüggemann <[email protected]>
- Loading branch information
1 parent
f616634
commit 3e00f77
Showing
12 changed files
with
129 additions
and
96 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
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
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
from ..module import ModuleHandler | ||
|
||
|
||
class MigrateMonitorsHandler(ModuleHandler): | ||
pass |
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,35 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from ..module import ModuleHandler, ModuleException | ||
from ..module import ModuleHandler | ||
|
||
class MigrateOSDsHandler(ModuleHandler): | ||
|
||
class MigrateOSDsHandler(ModuleHandler): | ||
def preflight_check(self): | ||
result = self.ceph.mon_command('osd dump') | ||
#raise ModuleException('test error') | ||
pass | ||
# result = self.ceph.mon_command("osd dump") | ||
# raise ModuleException('test error') | ||
|
||
def run(self) -> dict: | ||
osd_config = dict() | ||
for node, osds in self._data['analyze_ceph']['node']['ls']['osd'].items(): | ||
osd_config[node] = {'osds': {}} | ||
for node, osds in self._data["analyze_ceph"]["node"]["ls"]["osd"].items(): | ||
osd_config[node] = {"osds": {}} | ||
for osd in osds: | ||
osd_config[node]['osds'][osd] = dict() | ||
|
||
osd_config[node]["osds"][osd] = dict() | ||
|
||
for osd in self._data['analyze_ceph']['osd']['dump']['osds']: | ||
number = osd['osd'] | ||
uuid = osd['uuid'] | ||
for osd in self._data["analyze_ceph"]["osd"]["dump"]["osds"]: | ||
number = osd["osd"] | ||
uuid = osd["uuid"] | ||
for host in osd_config.values(): | ||
if number in host['osds']: | ||
host['osds'][number]['uuid'] = uuid | ||
if number in host["osds"]: | ||
host["osds"][number]["uuid"] = uuid | ||
break | ||
|
||
for node, values in osd_config.items(): | ||
devices = self._data['analyze_ceph']['ssh']['osd'][node]['devices'] | ||
for osd in values['osds'].values(): | ||
devices = self._data["analyze_ceph"]["ssh"]["osd"][node]["devices"] | ||
for osd in values["osds"].values(): | ||
for device in devices: | ||
if osd['uuid'] in device: | ||
osd['device'] = device | ||
if osd["uuid"] in device: | ||
osd["device"] = device | ||
break | ||
|
||
print(osd_config) |
Oops, something went wrong.