381 Commits

Author SHA1 Message Date
Davanum Srinivas
36fb964f0c Allow preexec_fn method for processutils.execute
If the user specifies preexec_fn, we should call that in
our existing _subprocess_setup. On windows, we silently
drop this preexec_fn as subprocess.Popen raises a ValueError
if we do pass it in.

Change-Id: I0176c66fa2de001aa14f0d928d06fd894de55511
2015-07-07 10:12:58 -07:00
OpenStack Proposal Bot
45ff557138 Updated from global requirements
Change-Id: I37b00f173bc67c3cedc39347b09835ff628334cd
2015-07-07 09:36:59 +00:00
Jenkins
7243f58810 Merge "processutils: ensure on_completion callback is always called" 2015-07-06 21:22:17 +00:00
Dirk Mueller
43722464b5 Use pypi name for requirements.txt
posix-ipc is an alias of the actual pypi name posix_ipc.

Change-Id: I1bf767dd0592a3c2e38e0fbf47344b692885e85e
2015-07-03 14:17:17 +02:00
Daniel P. Berrange
ab78480659 processutils: ensure on_completion callback is always called
If the subprocess.Popen.communicate method raises an exception,
the on_completion callback is never invoked. If a caller is
trying to use on_execute + on_completion to track lifecycle
of a process this creates a problem, as they cannot reliably
detect completion.

Change-Id: I22b2d7bde8797276f7670bc289d915dab5122481
Closes-bug: #1470868
2015-07-02 17:34:57 +01:00
OpenStack Proposal Bot
bc0235eb97 Updated from global requirements
Change-Id: I3a02320dd5ebaef8b324e5851053cdf50d373031
2015-06-30 20:02:06 +00:00
Jenkins
180b53b16e Merge "Add tox target to find missing requirements" 2015-06-30 19:05:27 +00:00
Steve Martinelli
e29cc549e1 Remove redundant fileutils
fileutils no longer seems to be used, remove it instead of
carrying it around.

Change-Id: Idac62aa3dbf1d6897f1b7405b094cab0f9f79912
2015-06-30 13:46:16 +00:00
Davanum Srinivas
eecaaeddaa Add tox target to find missing requirements
Change-Id: I2cfa6c2f5f763d710b2ac2f07bdf5aa80bc4a408
2015-06-26 07:18:38 -04:00
Jenkins
5f5bc73049 Merge "Ensure we 'join' on the timer watchdog thread" 2.2.0 2015-06-24 17:17:20 +00:00
Jenkins
c7bf8ee266 Merge "Use better timing mechanisms instead of time.time()" 2015-06-24 11:53:31 +00:00
OpenStack Proposal Bot
f93aeed9dd Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I4134d26d2459671b64c7d6f5f5976596bb791d2d
2.1.0
2015-06-23 06:14:54 +00:00
OpenStack Proposal Bot
df3a3004f5 Updated from global requirements
Change-Id: Ic56900bb1edb1010ed91902e6ca1906b864bdee3
2015-06-22 19:59:36 +00:00
Joshua Harlow
68a82f29f1 Ensure we 'join' on the timer watchdog thread
This object is just another thread and its cancel method
does not join on itself, so we should make sure that we do
to avoid leaving threads lying around.

Change-Id: I37e3170b58627dee93513ec222f9a55001389dad
2015-06-22 17:35:13 +00:00
Joshua Harlow
a0fabfc688 Use better timing mechanisms instead of time.time()
To ensure we show accurate timing information about
lock acqusition and release times use a timing mechanism
which can not/should not move backwards.

Change-Id: I9559b20cf7de67fc474e6e17eda23791ecc4122e
2015-06-22 10:34:30 -07:00
Jenkins
2fc22f9a30 Merge "Fix LockFixture docstring" 2015-06-22 13:37:29 +00:00
OpenStack Proposal Bot
2db9a21426 Updated from global requirements
Change-Id: I1c2882ec6c9b99aa3c4d5d371f8649522968a913
2015-06-22 08:26:55 +00:00
Jenkins
68929efcad Merge "Add 2 callbacks to processutils.execute()" 2015-06-17 09:13:33 +00:00
Tony Breeds
d8307005bf Add 2 callbacks to processutils.execute()
Add optional on_execute and on_completion callbacks to allow callers of
procesutils.execute() to track process completion asynchronously.

This could be used to cache the pid of long running tasks associated
with an instance and then clear the cache when the process completes.
While the tasks are running should it be required the pid retrieved and
the process can be signaled.

Co-Authored-By: abhishekkekane <abhishek.kekane@nttdata.com>
Change-Id: Ifc23325eddb523f6449ba06a2deb0885a8a7009d
2015-06-17 10:39:36 +10:00
OpenStack Proposal Bot
40f9025d0c Updated from global requirements
Change-Id: I4d8b1ed23ed96aa3c1a5df687f2661bca493b0c4
2015-06-16 19:22:12 +00:00
IWAMOTO Toshihiro
98c3227f91 Fix LockFixture docstring
Fixtures.useFixture takes a class instance, not a class type.

Change-Id: I48fff3f1a25b28e9ba15f79cbe18ea4c9582bd5c
2015-06-16 18:16:45 +09:00
Jenkins
4ac9247be5 Merge "Switch badges from 'pypip.in' to 'shields.io'" 2015-06-15 17:24:45 +00:00
OpenStack Proposal Bot
b0033d87bb Updated from global requirements
Change-Id: If678cb0796df57154d5f2c7812772ee2a1958d73
2015-06-15 03:12:09 +00:00
Joshua Harlow
fce7ef460d Switch badges from 'pypip.in' to 'shields.io'
The badge hosting at 'pypip.in' has been broken for a while
now, it was supposed to be fixed in the following PR(s):

- https://github.com/badges/pypipins/issues/39
- https://github.com/badges/pypipins/issues/38
- https://github.com/badges/pypipins/issues/37

That does not appear to have actually happened and/or is not
getting addressed, so switch to a more reliable badge hosting
site that provides the same badge information.

Change-Id: Ie327176665d286d22c84fa826a9be905c8a5f29d
2015-06-11 20:39:32 -07:00
OpenStack Proposal Bot
d6b9ed2def Updated from global requirements
Change-Id: I9dc5573004a6ee3648ab64b2fefe769c69ae8fbc
2015-06-10 23:49:28 +00:00
Joshua Harlow
9f22c45397 Replace locks and replace with fasteners library provides ones
The fasteners library (extracted from this library and a couple other
variations) provides the interprocess lock logic and the reader writer
lock logic so we can remove the local version and we can just use it
from that library instead.

The tests that were ensuring the internals of this file lock have
now moved to the repo where that library is (for the time being),
currently travis is testing that repo against py2.6, py2.7 and py3.4.

https://github.com/harlowja/fasteners/tree/master/fasteners/tests

Docs also exist at:

http://fasteners.readthedocs.org/en/latest/

Change-Id: I98565b22e68358efe28fea62f74f8ebfcc438ff7
2015-06-06 00:44:22 +00:00
Jenkins
ff18c14e5d Merge "Remove oslo namespace package" 2.0.0 2015-06-04 23:19:56 +00:00
Doug Hellmann
b9e8f9f9ae Remove oslo namespace package
Blueprint remove-namespace-packages

Depends-on: Iae62b48993eef3b31420f8cc245a55f5e303c4fc
Depends-on: If927fc7d70c625faa072dc8905a7e044f08aad33
both for designate

Change-Id: I60ac791560c49514d3a25e2b58b39a12d3da5d00
2015-05-29 19:16:00 +00:00
OpenStack Proposal Bot
9a963a9555 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I1482778ae774059867d06e0a40bbbbeb7c70fe5f
1.10.0
2015-05-28 06:05:57 +00:00
Davanum Srinivas
b01e2a9cc8 Sync from oslo-incubator
Copy fileutils.py changes from change id(s):
I369226f619895299c62f22a1debd0d4d120c912d
I7decb7bf5f3185f7d26ad99b0cb3475a88d3ec99

Also fix the openstack-common.conf to the correct package name

Change-Id: Ic77262bf94408395e720490264bcf7022461fe4d
2015-05-16 16:00:51 -04:00
Jenkins
bf419a381f Merge "Updated from global requirements" 2015-05-12 03:14:22 +00:00
OpenStack Proposal Bot
24033d3cd9 Updated from global requirements
Change-Id: I30118c812f7bdeca984301a35d620e5ddb621064
2015-05-11 14:03:20 +00:00
Davanum Srinivas
9433f0d394 Advertise support for Python3.4 / Remove support for 3.3
Change-Id: Ib6382d1ef3b3f336f1c83390b544d7e659c88511
2015-05-10 19:13:42 -04:00
OpenStack Proposal Bot
a592069220 Updated from global requirements
Change-Id: I7bb765fae1d2069f7088650feb6165fd0dbe050e
2015-05-07 23:36:31 +00:00
Jenkins
bc7615a62b Merge "Remove run_cross_tests.sh" 2015-05-04 14:41:49 +00:00
OpenStack Proposal Bot
e342fc8205 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Idf8df46c5788693818a63c1324a8bff18b4292d9
2015-05-03 06:05:22 +00:00
Doug Hellmann
926ee3b97a Remove run_cross_tests.sh
This script is part of the oslotest package now.

Change-Id: I19bbc21599873a65c01fe3f14c259e901f1eb5b5
2015-05-01 19:35:18 +00:00
OpenStack Proposal Bot
c0280ba6cb Updated from global requirements
Change-Id: Ia7b61e2455e87522917a83044f97615760e3baae
2015-04-28 21:42:05 +00:00
OpenStack Proposal Bot
ddba72fd9c Updated from global requirements
Change-Id: Ib63981b4da24430236bb5c5aa52be06138b59b4d
2015-04-24 13:03:45 +00:00
Victor Stinner
4d7dce2ea8 Add binary parameter to execute and ssh_execute
Add an optional binary parameter to execute() and ssh_execute()
functions of oslo_concurrency.processutils. If binary is True, stdout
and stderr are returned as byte strings on Python 2 and Python 3.

When Nova will be ported to Python 3, binary=True will be needed to get
binary outputs (like an encryption key, see the bug #1410348).

Add new tests.

This changeset does not change the default behaviour.

Change-Id: I283cadf04781942b65f211237070cc2354939cdb
Related-Bug: 1410348
1.9.0
2015-04-19 01:17:43 +02:00
Victor Stinner
c05c8c37be Port processutils to Python 3
On Python 3, execute() and ssh_execute() now return stdout and stderr as
Unicode. os.fsdecode() is used to stdout and stderr, it uses the locale
encoding with the surrogateescape error handler.
subprocess.Popen(universal_encoding=True) uses the same encoding and
error handler.

This change breaks the backward compatibility, but I believe that
Unicode is more convinient in Python 3 and it is what users expect. In
practice, there is no known (OpenStack) application compatible with
Python 3 using oslo_concurrency.processutils yet.

Add new tests.

This changeset does not change the behaviour on Python 2, only Python 3
is impacted.

Change-Id: Ibb510642c1440e2fbe7ad53d797bc7c32a3cbddf
2015-04-18 00:11:28 +02:00
Doug Hellmann
f366bd264b Uncap library requirements for liberty
Change-Id: I1d25cd86b0bdca8a7202a3ddd854e5f42f246000
Depends-On: Ib948b756b8e6ca47a4c9c44c48031e54b7386a06
2015-04-16 17:45:40 +00:00
Jenkins
e39e07bc56 Merge "Move fixtures to test-requirements.txt" 2015-04-10 18:22:56 +00:00
Jenkins
0e8b5eec29 Merge "Fix test_as_root* tests to work when run as root" 2015-04-10 18:19:49 +00:00
Thomas Bechtold
e3c24190ac Move fixtures to test-requirements.txt
fixtures is only used for testing. It's not a runtime requirement.

Change-Id: I23e3064c9fb843146c7b11a176344a469596f913
2015-04-10 17:45:03 +02:00
Steve Kowalik
fa415deb03 Fix test_as_root* tests to work when run as root
While using docker to test this module, I discovered that the
test suite does not pass because the processutils.execute() code
will not prepend the root helper because it already has root
permissions, which results in the shell trying to execute the
command 'a b c', rather than 'echo a b c'.

Change-Id: Id3429f06d6a0353f1cc4520af6daceed48c30071
2015-04-11 00:56:02 +10:00
Joshua Harlow
d04cf66a06 Add pypi download + version badges
Also makes the docs look more like the other
oslo libraries so that the content is easily readable
across projects.

Change-Id: I7b048bc4425197f87436281dd5e46619390c3f43
2015-04-07 21:09:17 +00:00
Steve Martinelli
fe84d2a4ab Standardize setup.cfg summary for oslo libs
Rather than repeating the library name, have the summary use proper
names instead.

Change-Id: Ifd52a0ef01836c0e21554338a592a70407ba5fd3
2015-04-04 02:01:33 -04:00
OpenStack Proposal Bot
e6f5e19e3d Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Id76fd87d68197e971ae78234e4339c164808e07f
2015-03-24 06:04:39 +00:00
OpenStack Proposal Bot
9f949fd4e7 Updated from global requirements
Change-Id: If0904a934140777cd01cb5d95f0d2c3167262b7c
2015-03-21 00:16:47 +00:00