Skip to content

Commit

Permalink
Merge "Check only our VG name when testing if VG exists"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Nov 18, 2013
2 parents 88e6883 + ccc4cca commit 1099f09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cinder/brick/local_dev/lvm.py
Expand Up @@ -95,7 +95,7 @@ def _vg_exists(self):
"""
exists = False
cmd = ['vgs', '--noheadings', '-o', 'name']
cmd = ['vgs', '--noheadings', '-o', 'name', self.vg_name]
(out, err) = self._execute(*cmd,
root_helper=self._root_helper,
run_as_root=True)
Expand Down
7 changes: 4 additions & 3 deletions cinder/tests/brick/test_brick_lvm.py
Expand Up @@ -67,9 +67,10 @@ def fake_execute(obj, *cmd, **kwargs):

if 'vgs, --noheadings, --unit=g, -o, name' == cmd_string:
data = " fake-volumes\n"
elif 'vgs, --noheadings, -o, name' == cmd_string:
data += " some-other-vg\n"
elif 'vgs, --noheadings, -o, name, fake-volumes' == cmd_string:
data = " fake-volumes\n"
if 'vgs, --version' in cmd_string:
elif 'vgs, --version' in cmd_string:
data = " LVM version: 2.02.95(2) (2012-03-06)\n"
elif 'vgs, --noheadings, -o uuid, fake-volumes' in cmd_string:
data = " kVxztV-dKpG-Rz7E-xtKY-jeju-QsYU-SLG6Z1\n"
Expand Down Expand Up @@ -99,7 +100,7 @@ def fake_execute(obj, *cmd, **kwargs):
data += " fake-volumes-2:/dev/sdb:10.00g:8.99g\n"
data += " fake-volumes-3:/dev/sdc:10.00g:8.99g\n"
else:
pass
raise AssertionError('unexpected command called: %s' % cmd_string)

return (data, "")

Expand Down

0 comments on commit 1099f09

Please sign in to comment.