diff options
| author | Jesse Andrews <anotherjesse@gmail.com> | 2010-06-24 04:11:54 +0100 |
|---|---|---|
| committer | andy <github@anarkystic.com> | 2010-06-24 04:11:54 +0100 |
| commit | 0ba3f01c66e9eb016311339cd1a23b4f8710c265 (patch) | |
| tree | 2e0088df1436598685ba7f42ea0aab815efe5ae5 /nova | |
| parent | c910b470e61a35230bc7ddaced13c3d51fac32fd (diff) | |
Revert "fix a bug with AOE number generation"
This reverts commit 7e8b5bcbad634cd4eabd0387d70beb25115bb680.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/volume/storage.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/nova/volume/storage.py b/nova/volume/storage.py index c2affe3ee..cf64b995f 100644 --- a/nova/volume/storage.py +++ b/nova/volume/storage.py @@ -243,12 +243,9 @@ class FakeVolume(Volume): pass def get_next_aoe_numbers(): - aoes = subprocess.Popen("sudo ls -1 /var/lib/vblade-persist/vblades/", shell=True, stdout=subprocess.PIPE).communicate()[0] - last_aoe = aoes.strip().split("\n")[-1] - if last_aoe == '': - last_aoe = 'e0.0' - logging.debug("Last aoe is %s" % (last_aoe)) - blade_id = last_aoe.rpartition(".")[2] + aoes = glob.glob("/var/lib/vblade-persist/vblades/e*") + aoes.extend(['e0.0']) + blade_id = int(max([int(a.split('.')[1]) for a in aoes])) + 1 + logging.debug("Next blade_id is %s" % (blade_id)) shelf_id = FLAGS.shelf_id - blade_id = int(blade_id) + 1 return (shelf_id, blade_id) |
