← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2019463] [NEW] processutils.trycmd('fallocate', '-l', '1', filepath) incorrect

 

Public bug reported:

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/imagebackend.py#L307

is incorrect, we need `-n` to specify the filename in order to detect
potential error

some test result, the file system is not able to fallocate so 2nd result
is expected


```
>>> from oslo_concurrency import processutils
>>> processutils.trycmd('fallocate', '-l', '1', "/gpfs/renpei_gpfs/icic/test/f")
('', '')
>>> a, b = processutils.trycmd('fallocate', '-l', '1', "/gpfs/renpei_gpfs/icic/test/f")
>>> a
''
>>> b
''
>>> can_fallocate = not err
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'err' is not defined
>>> can_fallocate = not b
>>> can_fallocate
True

```


```
>>> from oslo_concurrency import processutils
>>> processutils.trycmd('fallocate', '-l', '1', "-n", "/gpfs/renpei_gpfs/icic/test/f")
('', "Unexpected error while running command.\nCommand: fallocate -l 1 -n /gpfs/renpei_gpfs/icic/test/f\nExit code: 1\nStdout: ''\nStderr: 'fallocate: fallocate failed: keep size mode is unsupported\\n'")
>>> a,b = processutils.trycmd('fallocate', '-l', '1', "-n", "/gpfs/renpei_gpfs/icic/test/f")
>>> can_fallocate = not b
>>> can_fallocate
False
```

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2019463

Title:
  processutils.trycmd('fallocate', '-l', '1', filepath) incorrect

Status in OpenStack Compute (nova):
  New

Bug description:
  https://github.com/openstack/nova/blob/master/nova/virt/libvirt/imagebackend.py#L307

  is incorrect, we need `-n` to specify the filename in order to detect
  potential error

  some test result, the file system is not able to fallocate so 2nd
  result is expected

  
  ```
  >>> from oslo_concurrency import processutils
  >>> processutils.trycmd('fallocate', '-l', '1', "/gpfs/renpei_gpfs/icic/test/f")
  ('', '')
  >>> a, b = processutils.trycmd('fallocate', '-l', '1', "/gpfs/renpei_gpfs/icic/test/f")
  >>> a
  ''
  >>> b
  ''
  >>> can_fallocate = not err
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  NameError: name 'err' is not defined
  >>> can_fallocate = not b
  >>> can_fallocate
  True

  ```


  ```
  >>> from oslo_concurrency import processutils
  >>> processutils.trycmd('fallocate', '-l', '1', "-n", "/gpfs/renpei_gpfs/icic/test/f")
  ('', "Unexpected error while running command.\nCommand: fallocate -l 1 -n /gpfs/renpei_gpfs/icic/test/f\nExit code: 1\nStdout: ''\nStderr: 'fallocate: fallocate failed: keep size mode is unsupported\\n'")
  >>> a,b = processutils.trycmd('fallocate', '-l', '1', "-n", "/gpfs/renpei_gpfs/icic/test/f")
  >>> can_fallocate = not b
  >>> can_fallocate
  False
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2019463/+subscriptions