diff options
| author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-05-14 01:42:26 +0900 |
|---|---|---|
| committer | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-05-14 01:42:26 +0900 |
| commit | aaec8400be701c674bbf89badd59ee9468827ed9 (patch) | |
| tree | eeb63be0022b8091f9a94b763baf4d97b0c556db | |
| parent | 4f7cfba4a00f04b7c30c61da2946f183241a7c7f (diff) | |
| download | nova-aaec8400be701c674bbf89badd59ee9468827ed9.tar.gz nova-aaec8400be701c674bbf89badd59ee9468827ed9.tar.xz nova-aaec8400be701c674bbf89badd59ee9468827ed9.zip | |
volume/driver: make unit test, test_volume, pass
fake command executer doesn't return command result.
Which return None instead of string.
So add None check to make unit test pass.
| -rw-r--r-- | nova/volume/driver.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nova/volume/driver.py b/nova/volume/driver.py index a6cf2cb46..0807ff476 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -145,9 +145,11 @@ class VolumeDriver(object): '-C', '-o', 'Attr', '%s/%s' % (FLAGS.volume_group, volume['name'])) - out = out.strip() - if (out[0] == 'o') or (out[0] == 'O'): - raise exception.VolumeIsBusy(volume_name=volume['name']) + # fake_execute returns None resulting unit test error + if out: + out = out.strip() + if (out[0] == 'o') or (out[0] == 'O'): + raise exception.VolumeIsBusy(volume_name=volume['name']) self._delete_volume(volume, volume['size']) |
