LVM: Use --readonly for lvdisplay in lv_has_snapshot
Follow-on to we only need readonly
mode for lvdisplay.
@@ -772,7 +772,8 @@ class LVM(executor.Executor):
def lv_has_snapshot(self, name):
cmd = LVM.LVM_CMD_PREFIX + ['lvdisplay', '--noheading', '-C', '-o',
- 'Attr', '%s/%s' % (self.vg_name, name)]
+ 'Attr', '--readonly',
+ '%s/%s' % (self.vg_name, name)]
out, _err = self._execute(*cmd,
root_helper=self._root_helper,
run_as_root=True)
