Commit Graph

472 Commits

Author SHA1 Message Date
Andreas Jaeger 95d65706ce Retire repo
This repo was created by accident, use deb-python-oslo.concurrency
instead.

Needed-By: I1ac1a06931c8b6dd7c2e73620a0302c29e605f03
Change-Id: I81894aea69b9d09b0977039623c26781093a397a
2017-04-17 19:34:53 +02:00
OpenStack Proposal Bot 2e8d5481b1 Updated from global requirements
Change-Id: I2e9ff687f0408795147e5b8c4769aa3a21fa87bd
2016-07-29 02:33:45 +00:00
yanheven 0c3a39eded Fix parameters of assertEqual are misplaced
Many assertEqual sentences don't follow assertEqual(expected, actual),
These misplaces have 2 impacts:
1, giving confusing messages when some tests failed.
2, mislead other developers, new test modules may follow these wrong pattern.

This patch fix all of them.

Change-Id: I00bb4801c208d0eb8078e8a34ae52f9bcfe0b1a6
Closes-Bug: #1604213
2016-07-23 01:12:19 +08:00
ChangBo Guo(gcb) e9a0914493 Add Python 3.5 classifier and venv
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv. This commit also removes py34 specific venv.

Change-Id: I50ddda7d96c77e7db60aa0b42e8e3b701dadf404
2016-07-14 12:23:14 +08:00
OpenStack Proposal Bot f7821d9cdb Updated from global requirements
Change-Id: I40bc3ca015baff9c95499d395168a41eef1d3499
2016-07-09 19:25:43 +00:00
OpenStack Proposal Bot 68df6b2847 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I3657f625009612562b2a40e7295089cf54151846
2016-07-01 08:12:51 +00:00
OpenStack Proposal Bot f13a21ce94 Updated from global requirements
Change-Id: I75f0c00c84523ac027b9f68e3980d7de2815ee02
2016-06-30 18:48:12 +00:00
OpenStack Proposal Bot ec7be5293e Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I324acd475c84727b21aa9905c1184add135eb0cd
2016-06-11 07:59:54 +00:00
OpenStack Proposal Bot 4c60f8e984 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ifa683e2c40e33c05a4b6f6be514bb8a879179ee8
2016-06-04 07:08:30 +00:00
OpenStack Proposal Bot bbcb1adeea Updated from global requirements
Change-Id: Ia49ba770943fee9f3e74cf860a2f77a7a3c14ae6
2016-06-03 18:17:49 +00:00
Kirill Bespalov 9a36c18b12 Add reno for releasenotes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: Ie3f6653a27a49d8b2fced3f399b1d4c8f0c95b7c
2016-05-20 17:56:23 +03:00
Jenkins e1cde97028 Merge "Add timeout option to ssh_execute" 2016-05-14 13:33:14 +00:00
Yuriy Taraday 7e47d32161 Add doc/ to pep8 check
We had unused imports there, this would prevent us from letting more of
such errors in.

Change-Id: Ie78c18dd3b9ab34370e47eba98b32740e0c83e1d
2016-05-12 14:05:20 +03:00
ChangBo Guo(gcb) 89f890b465 Remove unused import statement
We don't use fnmatch and fileinput, so
remove them.

Change-Id: Ic49f3a03f4ccafcd02c549a6bdb0a3175f9e07e1
2016-05-12 16:34:28 +08:00
zhangsong c876fabd07 Add timeout option to ssh_execute
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
2016-05-12 10:41:52 +08:00
Jenkins f8fd4058f3 Merge "Fix wrong import example in docstring" 2016-05-11 13:29:32 +00:00
ChangBo Guo(gcb) 7279c316c8 Fix wrong import example in docstring
Change-Id: I0abc5403851f9ab2f78cdf26d29b82c3ec76ec25
2016-05-11 19:21:43 +08:00
ChangBo Guo(gcb) 45cf9f0a9e Trivial: ignore openstack/common in flake8 exclude list
The directory openstack/common doesn't exist any more.
So remove it from flake8 exclude list.

Change-Id: Ieb4a5aac33b69f4cd7a4c0761836cb6bee087430
2016-05-11 19:19:39 +08:00
Jenkins 6bae2be9ba Merge "processutils: add support for missing process limits" 2016-05-04 13:24:04 +00:00
OpenStack Proposal Bot 09827765b9 Updated from global requirements
Change-Id: Icf2fd29b3d8fa5b8ab678d4085fd72970122c64e
2016-04-30 18:07:35 +00:00
OpenStack Proposal Bot 342efd30b6 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I65f5fc2140e9a12057343f89596f97648315e647
2016-04-21 07:17:11 +00:00
Daniel P. Berrange 8af826953d processutils: add support for missing process limits
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
2016-04-19 14:35:24 +01:00
Joshua Harlow 7bc24c5d14 Remove direct dependency on babel
The dependency on oslo.i18n already forces this requirement.

Change-Id: I4839b63ec9c8005f38231ee11f433a4c334e96d5
2016-04-18 13:18:20 -07:00
OpenStack Proposal Bot ca59541f5e Updated from global requirements
Change-Id: Ie01f18f40bc35f7dc57c083014c94b9a949a6ef6
2016-04-13 12:47:21 +00:00
OpenStack Proposal Bot 6da5df0f4a Updated from global requirements
Change-Id: Ib2b3d0985a0c39e6fcb894dedb956c420a8f7fc6
2016-04-08 00:31:50 +00:00
OpenStack Proposal Bot f22886e0f2 Updated from global requirements
Change-Id: Iaf46167e8c39c5f546c7d86b85d84de6f500b1e8
2016-04-07 17:13:01 +00:00
Joshua Harlow cbdf411306 Add a few usage examples for lockutils
There was a complaint that the usage examples in oslo.concurrency
are lacking (which they are) so this addresses some of those concerns
by adding a few usage examples (and descriptions).

Change-Id: I0738b898f1235e83a600c7732d70058b3fd3860f
2016-03-17 15:06:53 -07:00
Jenkins 7cd7883936 Merge "Revert "Use tempfile.tempdir for lock_path if OSLO_LOCK_PATH is not set"" 2016-02-29 18:27:03 +00:00
Yuriy Taraday 499d5aa36d Revert "Use tempfile.tempdir for lock_path if OSLO_LOCK_PATH is not set"
This reverts commit 5021ef82fd.

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
2016-02-26 16:36:17 +03:00
Jenkins 5ee71e0acf Merge "Use tempfile.tempdir for lock_path if OSLO_LOCK_PATH is not set" 2016-02-26 11:11:14 +00:00
OpenStack Proposal Bot 951be63b4e Updated from global requirements
Change-Id: I1650fd8adb65777de950fe25a4585a9559fb9ecb
2016-02-26 01:52:10 +00:00
Sean M. Collins 5021ef82fd Use tempfile.tempdir for lock_path if OSLO_LOCK_PATH is not set
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
2016-02-25 15:34:52 +00:00
OpenStack Proposal Bot 0fc12ffaaf Updated from global requirements
Change-Id: I535d094e5097b3b20cba25828df860f643b84fa4
2016-02-20 21:59:24 +00:00
Jenkins 34797e0441 Merge "Make ProcessExecutionError picklable" 2016-02-20 01:06:39 +00:00
OpenStack Proposal Bot 6c0f7ffd1e Updated from global requirements
Change-Id: I34f0b21afc4eba3a2503e3021ac121180d588948
2016-02-19 18:55:26 +00:00
Angus Lees 9d28946395 Make ProcessExecutionError picklable
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
2016-02-19 15:52:23 +11:00
OpenStack Proposal Bot fa04ee7df3 Updated from global requirements
Change-Id: Ibeffb23a0ef4f94d2f8f18f2fdebb491f88b3943
2016-02-10 21:57:56 +00:00
Jenkins 2217533882 Merge "Add prlimit parameter to execute()" 2016-02-01 07:30:47 +00:00
Andreas Jaeger e9d00d16ae Update translation setup
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
2016-01-28 20:41:28 +01:00
Victor Stinner b2e78569c5 Add prlimit parameter to execute()
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
2016-01-28 15:00:06 +01:00
OpenStack Proposal Bot 70118c268f Updated from global requirements
Change-Id: I5d9484bae360143185fe6efbc2633ce9b01614b1
2016-01-26 23:27:46 +00:00
OpenStack Proposal Bot e168906ae4 Updated from global requirements
Change-Id: I3396829a7b7d3c31e6cae816aefca222d1048cbc
2016-01-24 20:52:51 +00:00
OpenStack Proposal Bot 3eed329cbe Updated from global requirements
Change-Id: I26110041758b218b7ce93c884082042019ee1d0e
2016-01-23 10:34:38 +00:00
OpenStack Proposal Bot 4b37f1362b Updated from global requirements
Change-Id: Ia560a40275adf735f529c29c7ced64003ca2709b
2016-01-18 22:44:51 +00:00
Jenkins 08d0677018 Merge "Updated from global requirements" 2016-01-16 10:34:50 +00:00
OpenStack Proposal Bot fec46db263 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I42faa1a3e1c6119c33301d83a64000dc32dceb9e
2016-01-16 06:29:19 +00:00
OpenStack Proposal Bot ca9801d4e4 Updated from global requirements
Change-Id: I0302364cb544b7e94ddb3f4f314ff0975a5b8ff2
2016-01-16 03:31:03 +00:00
Davanum Srinivas 491af16f80 Remove unnecessary package in setup.cfg
We don't need two entries as fixtures is under oslo_concurrency

Hat Tip to @clarkb

Change-Id: Ifb2b5b761ec3832de42beaf0505510d30251efba
2016-01-11 13:40:09 -05:00
OpenStack Proposal Bot 06035626c1 Updated from global requirements
Change-Id: Ie68b9a373cc0ed970cb4fd5c1b2dbe5a3914b47d
2016-01-07 06:56:18 +00:00
OpenStack Proposal Bot 233e91ab67 Updated from global requirements
Change-Id: Ie5b9073721623f11d6adebd1bdf769383a88bde5
2016-01-06 23:18:25 +00:00