| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: I324acd475c84727b21aa9905c1184add135eb0cd
|
|
|
|
|
|
|
| |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: Ifa683e2c40e33c05a4b6f6be514bb8a879179ee8
|
|
|
|
|
|
|
| |
An initial patch to add reno and create a base directory for
release notes
Change-Id: Ie3f6653a27a49d8b2fced3f399b1d4c8f0c95b7c
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add an optional timeout parameter to ssh_execute() method of
oslo_concurrency.processutils. Timeout is None means infinity,
which is the default.
Change-Id: I45532799ecd23ff8c5572036d06725e71965b2b5
Closes-Bug: #1580826
|
|/
|
|
| |
Change-Id: I0abc5403851f9ab2f78cdf26d29b82c3ec76ec25
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original commit adding support for process limits only wired
up address space, max files and resident set size limits. This
is not sufficient to enable nova to protect qemu-img commands
against malicious images.
This commit adds support for the remaining limits supported
by python: core file size, cpu time, data size, file size,
locked memory size, max processes and stack size.
Related-bug: #1449062
Change-Id: I164c4b35e1357a0f80ed7fe00a7ae8f49df92e31
|
|/
|
|
|
|
|
| |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: I65f5fc2140e9a12057343f89596f97648315e647
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 5021ef82fd8f0323b82d6d010bff9dab8a0cbcec.
That commit set default location for lock files to a world-writable
directory (like /tmp) which violates security precaution stated right in
the help string of lock_path config variable: lock_path should be
writable by the user of the process using it only.
There is some history behind this:
- when we decided to not do tempfile.mkdtemp if lock_path were not set
(because it was broken), it broke upgrades for all components
(starting with Cinder;
- it was suggested to provide the same default value:
https://review.openstack.org/60274
but it was not accepted because it weakens security;
- there was a thread about this in ML, please read it for more history:
http://lists.openstack.org/pipermail/openstack-dev/2013-December/021055.html
it ended up with understanding that only a project using the library
can provide sane default value for lock_path, not the library itself.
Change-Id: I801004ad3c83862849696f00c6e7ca9877fd496b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DevStack spends a lot of time setting lock_path in a bunch of
locations.
http://codesearch.openstack.org/?q=oslo_concurrency%20lock_path&i=nope&files=&repos=
The default for lock_path is an environment variable
OSLO_LOCK_PATH.
http://codesearch.openstack.org/?q=OSLO_LOCK_PATH&i=nope&files=&repos=
Since the default is to consult an environment variable, which may not
even be set, this means that really there is no default. If you do
not set it - you end up getting errors like:
http://paste.openstack.org/show/488108/
Ideally - a library should have a reasonable default, where if a user
doesn't set something, the default will at least work. So, let's use
Python's built in tempfile module, which has fairly complex rules for
determining a sane directory to place temporary items in.
https://docs.python.org/2/library/tempfile.html#tempfile.tempdir
Change-Id: I6906af43bc0255cd215f2d9584ea000c81f5880e
|
|
|
|
|
|
|
|
|
|
|
| |
Serialising/deserialising exceptions in python follows the protocol
defined by pickle. It relies on the base Exception.__init__ setting
self.args, and later resurrects exceptions with class(*args).
This change rewrites processutils.ProcessExecutionError so it survives a
pickle.dumps/loads round-trip.
Change-Id: I9b8d104f60df868be7b808c72c932d08f1752777
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a new oslo_concurrency.prlimit module which is written to be used
on the command line:
python -m oslo_concurrency.prlimit --rss=RSS -- program arg1 ...
This module calls setrlimit() to restrict the resources and then
executes the program. Its command line is written to be the same than
the Linux prlimit system program.
Add a new ProcessLimits class processutils: resource limits on a
process.
Add an optional prlimit parameter to process_utils.execute(). If the
parameter is used, wrap the command through the new oslo_concurrency
prlimit wrapper.
Linux provides a prlimit command line tool which implements the same
feature (and even more), but it requires util-linux v2.21, and
OpenStack targets other operating systems like Solaris and FreeBSD.
Change-Id: Ib40aa62958ab9c157a2bd51d7ff3edb445556285
Related-Bug: 1449062
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow new infra setup for translations, see spec
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html
for full details.
This basically renames
oslo.concurrency/locale/oslo.concurrency.pot to
oslo_concurrency/locale/oslo_concurrency.pot. For this we need to update
setup.cfg.
Update also domain name in i18n.py.
Change-Id: Ie774c4252f8481f2541ed0a2cad565d149dfcc72
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems we provide (and projects use) the provided decorator
'synchronized_with_prefix' but we don't provide an equivalent function
to complement that function to clean up its created lock files.
Providing a complementary method seems pretty useful for projects
that actually clean up these lock files (if any actually do in the
first place).
Change-Id: I601ce3992411e6a2ddded13aba4ac068cf8f14e2
|
|
|
|
| |
Change-Id: I921e29d25e0cfb089028f780bc942a60c9712278
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Document in which version new types and functions were added using
".. versionadded:: x.y". Document changes using
".. versionchanged:: x.y."
For watchdog module, add the versionadded tag in the module top
docstring, not on each type/function.
Add docstring to ssh_execute().
I used "git blame" + "git tag --contains=SHA1" to find these version,
and then I checked manually each version.
Change-Id: I56a7d8a4335833e9b49eedab026d20adfeedf942
|
|
|
|
| |
Change-Id: I700b6de69411330b2a0fd8f2cdafa4026f85f1c7
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Iac6f4d860c220c653bbae17e7b1d69249259bd88
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the utility function gets a better name.
For example:
$ python
>>> from oslo_utils import reflection
>>> class A(object):
... def m(self):
... pass
...
>>> z = A()
>>> reflection.get_callable_name(z.m)
'__main__.A.m'
Versus:
>>> z.m.__name__
'm'
Change-Id: I2daadd969383aaf49ad87876ba108dd80dd56f08
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
fileutils no longer seems to be used, remove it instead of
carrying it around.
Change-Id: Idac62aa3dbf1d6897f1b7405b094cab0f9f79912
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Fixtures.useFixture takes a class instance, not a class type.
Change-Id: I48fff3f1a25b28e9ba15f79cbe18ea4c9582bd5c
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Copy fileutils.py changes from change id(s):
I369226f619895299c62f22a1debd0d4d120c912d
I7decb7bf5f3185f7d26ad99b0cb3475a88d3ec99
Also fix the openstack-common.conf to the correct package name
Change-Id: Ic77262bf94408395e720490264bcf7022461fe4d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ib690450269c281409a095ed44bf5791d6c2a7cc5
|
|/
|
|
|
|
|
|
|
| |
Provide an API to discover the path being used to store external lock
files. Tempest will use this to set up some additional locking and to
test its own behavior. Other projects might use it for error reporting
or other purposes.
Change-Id: Iad40c67072333cc25a6d3e39d7535ff14b573504
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Issue: simultaneous usage of 'shell' and 'run_as_root' options led
to error.
Cause: it's actually a concealed TypeError: in 'shell'
mode the command argument is assumed to be a string, elsewhere
a list/tuple.
Fix: the command editing implied by 'run_as_root' is performed
with care taken of above tacit type assumption.
Change-Id: Iaba33e6fda67793ae2874ba278c990271ee5e47f
Closes-Bug: #1382873
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Related-blueprint: drop-namespace-packages
Change-Id: Ic8247cb896ba6337932d7a74618debd698584fa0
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently folks end up using os.chdir() (see bug listed below) as
we are not exposing the subprocess.Popen's cwd parameter. It's
better to add a cwd parameter in processutils.execute so folks
do not have to issue chdir() before and after the processutils.
execute and there's less scope for problem as documented in
the bug.
Closes-Bug: #1414530
Change-Id: Ia4c77593c0f8301e059b349290e8663614a7ccfd
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is used to allow us to test both with and without eventlet.
It wasn't copied to the new tests directory in the namespace move,
which means that once the old tests go away eventlet won't be
monkey patching even when we try to make it. Also, there's a race
depending on whether the top-level tests are run first, or the new
package ones.
Change-Id: Ie2705c3d21625e594471f27eefc3ac3147390cb7
|
| |
| |
| |
| |
| | |
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 7c7493feb53429577efca2c4b0380af03ddc149b.
This change breaks the API of execute() and breaks nova's tests.
Closes-Bug: #1410348
Change-Id: I33fa9b4e6099f521e0de3cb4585016fd694c4548
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Only had to add a couple of newlines to the end of files.
Change-Id: Ie7c31b3c9fc4ac00e8e3281888ab9faf84bc19c5
|
|\ \ \ \
| |_|_|/
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Lockutils uses %0.3fs for time format, which gives us a convenient
time in milliseconds. Process utils was an unbounded string which
gives us times like:
CMD "cat /proc/31599/cmdline" returned: 0 in 0.00526595115662s execute
The super long time strings are mostly confusing, and millisecond
accuracy should be sufficient for processutils.
Change-Id: I57f21b18ab060a36c3d88b0c5a94430eafeb02a2
|