Fixes nbd device can't be released error
When the 'mount' operation is successful but stderr is not empty during injecting key/file into image, there may be some warning messages output to stderr, so we need to discard them and continue to inject files into image. Fixes bug #1152519 Change-Id: Icc7d15196f3ee67674f9d815ddeef4378f363e2c
This commit is contained in:
parent
8c96d09ba3
commit
786424b456
|
@ -187,9 +187,10 @@ class Mount(object):
|
|||
LOG.debug(_("Mount %(dev)s on %(dir)s") %
|
||||
{'dev': self.mapped_device, 'dir': self.mount_dir})
|
||||
_out, err = utils.trycmd('mount', self.mapped_device, self.mount_dir,
|
||||
run_as_root=True)
|
||||
discard_warnings=True, run_as_root=True)
|
||||
if err:
|
||||
self.error = _('Failed to mount filesystem: %s') % err
|
||||
LOG.debug(self.error)
|
||||
return False
|
||||
|
||||
self.mounted = True
|
||||
|
|
Loading…
Reference in New Issue