64 Commits

Author SHA1 Message Date
Jenkins
fc90e10f7d Merge "Work toward Python 3.4 support and testing" 2015-02-06 21:55:19 +00:00
Sean Dague
b588479726 remove need for netaddr
The only reason netaddr was pulled in was for ip validation routines
which exist in oslo.utils. Use those instead.

Change-Id: Ic3beee7e8bfb2b2d16ecac9be6322fe2704c70bd
2015-01-15 12:15:51 +00:00
Sean Dague
452dfc65cc remove extraneous --concurrency line in tox
the default testr mode is 1 worker per cpu, which is also what
--concurrency=0 produces. There is no reason to put this in explicitly

Change-Id: I49613ba409f55a21a5392a4276e3f8f6dbc169fe
2015-01-14 22:14:10 +00:00
Zhi Yan Liu
882049a613 Using oslo.concurrency lib
Replace processutils and lockutils modules of oslo-incubator with
oslo.concurrency lib.

Change-Id: Ic1af8753a70f1aada22efe8132e48cbc16e14f3f
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2014-12-17 13:20:54 +08:00
Doug Hellmann
50a5ffed12 Use testr directly from tox
Invoking testr directly lets us pass arguments to it through tox so we
can, for example, only run a subset of the tests.

Change-Id: I21351880db0848b860e7c61d4a8c711be2a49de0
2014-12-10 14:41:39 -05:00
Jeremy Stanley
c0393cc916 Work toward Python 3.4 support and testing
Change-Id: I0f65d39e93f811892fa79b278eec1335fd5c59eb
2014-11-26 15:54:05 +00:00
Julien Danjou
067b0db570 Remove Python 2.6 classifier
Glance does not support Python 2.6 anymore starting with Kilo and might
not work correctly with it, so remove the classifier.

Change-Id: Ibd7ad401198749f975fb19007549f7623caae546
2014-11-25 17:00:14 +01:00
James Carey
3f2a56ae65 Move from using _ builtin to using glance.i18n _
The builtin _ should not longer be used.  Instead _
should be explicitly assigned from glance.i18n.

This patch does the following:
  (1) adds these explict assignments to any
      glance file that was missing them,
  (2) removes the defintion of _ as a builtin from
      tox.ini so that a pep8 failure will occur
      if _ is not defined,
  (3) removes calls to install().

This removes the last direct use of gettextutils by glance.
The indirect uses, via openstack/common, will be removed
in the next sync with oslo.

Change-Id: Ie54e8a67e747e022cc01022dfad35d89686bdfc4
2014-11-21 18:51:19 +00:00
Julien Danjou
fadbef8511 hacking: upgrade to 0.9.x serie
Change-Id: I252758fd633662de9659a402c5e3d7e3ce1fae0f
2014-10-06 14:41:03 +02:00
Oleksii Chuprykov
868fd6e383 Run tests with default concurrency 0
Setting concurrency to 0 would enable Glance tests to be run using the
the total number of cores on the system rather than by a single one.

This would, by default, speed up the run time of tests for developers
who are not aware about it. Also, any jobs which run these tests for
Continuous Integration would be benefitted without having to deal with
the machine level logic.

Closes-Bug: #1368274

Change-Id: I0842b0c0be1272d479fad9ef7609cd8a29231cb5
2014-09-30 11:37:02 +00:00
Thomas Bechtold
dd9520265b Add specific docs build option to tox
Add doc venv to align with other OpenStack projects (such as keystone,
heat and nova) who are using 'docs' for their doc builds.

Change-Id: I8bccbf9c6b1eae5de9f74396fd5159662ad04149
2014-09-24 00:18:44 +00:00
Zhi Yan Liu
819f28a0b8 Enabling separated sample config file generation
As a common approach most projects used now and Oslo preferred, this
change enabled sample configuration file generation mechanism for
each Glance services.

This change, as an enhancement, allows generating separated sample
configuration files for each Glance major services, e.g.:

    etc/glance-api.conf.sample
    etc/glance-cache.conf.sample
    etc/glance-manage.conf.sample
    etc/glance-registry.conf.sample
    etc/glance-scrubber.conf.sample

It is different than I94d486d6686815c45705a7a9b00fb26062e1eb63
which only supports generating an unified sample configuration
file to including all Glance available options.

This mechanism  not only can help auditing by packager, milestone
maintainer or developer as a function (testenv) of tox, but also
those separated configuration files could make deployment be easy.
And it helps keeping sample configuration files be update with
code change.

The change added "genconfigs" function as a tox testenv (-egenconfigs),
and it dependes on oslo-config-generator function of oslo.config.

The change doesn't introduce those sample files Glance repo, so
next step is to investigate if we can generate them in gate
automatically when a change was merged.

Related-Change-Id: I15686708fc9460948a58cfea3d18dae40ba1fda9
Related-Change-Id: Iae31856d5886ee78786972d80c7c103c3460a2b3
Related-Change-Id: I76043b08e2872867e5af2a5ac902e4d092fda5c8
Closes-Bug: #1300546
Closes-Bug: #1361963

Change-Id: Ibe03a3fe80b96ca32acb1a6bea7e38e6075951bb
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2014-09-17 13:19:00 +08:00
Julia Varlamova
0c151d7d7e Enable F821 check: undefined name 'name'
Enable F821 and fix usage of undefined variables.

In glance/common/client.py in BaseClient class image_iterator()
function returns instances of unexisting classes:
- SendFileIterator
- ImageBodyIterator
Since we have not these classes functionality now, we will use
utils.chunkreadable() function instead.

Delete image_iterator() function.

Change-Id: Ie1a8c66e5df2836e6e9aadfb1013d69fc6f710e6
2014-07-23 16:28:24 +04:00
Christian Berendt
86dd9ff66c debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

This patch adds a new hacking check - N319 - that ensures all
debug log messages don't have translations.

Change-Id: I9dd958b904671a7eb95883026e14684469dc52d5
Closes-Bug: #1317847
2014-05-23 15:57:06 +02:00
Jenkins
1ac9192e96 Merge "Enable H304 check" 2014-04-20 14:48:32 +00:00
Andreas Jaeger
9777660809 Fix Jenkins translation jobs
The job glance-propose-translation-update
does not update from
transifex since our po files contain duplicate entries where
obsolete entries duplicate normal entries.

Remove all obsolete entries to fix the job.

Add test to pep8 that checks that no new breakages get
introduced.

Change-Id: I1bae1c1bf27bf664b24cf75fc96efb0fcfddc392
Closes-Bug: #1299349
2014-04-03 20:13:12 +02:00
Julia Varlamova
5843e071d4 Enable H304 check
Enable H304: no relative imports

Fix import in tools/install_venv.py

Change-Id: I099ed65db9b42223eaa4b66a3a5c6113d1cc56fe
2014-03-20 10:34:26 +00:00
Julia Varlamova
67c79540c7 Enable hacking H301 and disable H304, H302
Enable hacking H301: one import per line. H304 and H302 check enables too,
so we temporarily disable it since it does not pass.

Fix imports in files below.

Add # noqa to migration scripts.

Change-Id: I6a8d4dcd9c3195d2848f218aafe304b1240ab60c
2014-02-18 16:05:18 +04:00
Julia Varlamova
3fa66f63c4 Enable F841 check
Enable F841 check: local variable 'name' assigned but never used.

Make appropriate changes to files listed below.

Change-Id: I02837d4abf421dc9d85f3b01587120fd68acfa12
2014-02-13 16:54:12 +04:00
Jeremy Stanley
00467964c7 Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: Ib10f5ef2fd747e38012384f1c6cbe147da8c2573
Closes-Bug: #1277495
2014-02-10 02:59:56 +00:00
Zhi Yan Liu
d7f1221684 Switch to testrepository for running tests
OpenStack as a whole is moving towards using testrepository and
testtools for running tests. To that end, bring Glance into line by
switching it to use testrepository to run tests.

This copies run_tests.sh and tools/colorizer.py from Nova.

This change also has some minor changes to make run_test.sh work well.

Partial fixes bug: 1179009
Fixes bug: 1271806

Change-Id: Ic265bc0d2f1528358f6e8ee5b4139f991923fc72
Signed-off-by: Steve Kowalik <steven@wedontsleep.org>
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2014-01-29 08:30:55 +08:00
Julia Varlamova
1d0327f13c Enable H302 check
Enable H302 (import only modules) which passes without any changes to files.

Change-Id: Ibcc609ffad404e8d73a4828b7b18892444e7454d
2014-02-07 16:29:36 +04:00
Julia Varlamova
fa3575d8fe Enable H202 check
Enable H202 check: assertRaises Exception too broad.

Make changes to glance/tests/unit/test_notifier.py

Change-Id: I258367172e77312ddda06132d2e8371e8fff81e7
2014-02-06 15:30:47 +04:00
Julia Varlamova
775072583b Enable hacking H703 check
Enable hacking H703 (multiple positional placeholders)
and fix string formatting in files listed below:

- glance/api/authorization.py
- glance/api/v1/images.py
- glance/api/v1/upload_utils.py
- glance/api/v2/image_data.py
- glance/cmd/replicator.py
- glance/common/property_utils.py
- glance/common/utils.py
- glance/common/wsgi.py
- glance/image_cache/__init__.py
- glance/notifier.py
- glance/store/__init__.py
- glance/store/filesystem.py
- glance/store/gridfs.py
- glance/store/swift.py

Change-Id: Idb871eadcad1bd0cc2d2710be7469cf66360c3a7
2014-01-27 14:32:04 +04:00
Dirk Mueller
3eee59d39f Enable gating on H501
H501 - "avoid locals() on string formatting" passes
currently, so no reason to blacklist it.

Change-Id: I9fb1823a598679c0e95c88a8ce4f93629508a80c
2014-01-23 00:15:43 +01:00
Dirk Mueller
17f4c09d0a Switch to Hacking 0.8.x
Blacklist the few hacking warnings that still trigger, those
can be fixed in a followup commit. Start Gating on the new
tests of Hacking 0.8.x (which are all passing here).

Change-Id: I3be1a9a517ec399dd92252a7c705d1a7a6d5e4c2
2014-01-08 00:48:26 +01:00
Dirk Mueller
f0dad5c5d5 Enable gating on F811 (duplicate function definition)
Change-Id: Ifbf233ccbb7cc012d5dae50f9b303cfca592788d
2014-01-02 12:57:15 +01:00
Dirk Mueller
d6114f914c Fix and enable gating on H306
Fix fallout of Hacking check: Imports should be in alphabetical order

Change-Id: I179711c8448208592490ffa47d51419779940014
2014-01-01 16:44:19 +01:00
Yanis Guenane
ec08ca1a87 Make code base E125 and E126 compliant
This commit makes the glance code base E125 and E126 compliant :
  * E125 continuation line does not distinguish itself from next logical line
  * E126 continuation line over-indented for hanging indent

Change-Id: I7120149bedb665fb66320498fe98948602a6cd52
Closes-bug: #1263437
2013-12-30 13:03:24 +00:00
Yanis Guenane
366a68b87d Enable H233/H301/H302 tests that are ignored at the moment
* H233 use of print operator
  * H301 one import per line
  * H302 import only modules

Change-Id: I752c3c117e2575b30cc96d68c18df365d595588e
Closes-bug: #1263535
2013-12-23 23:57:10 +00:00
Yanis Guenane
317ad31637 Make Glance code base H102 compliant
Add the Apache headers where it was missing so the Glance
code base can be H102 compliant

Change-Id: If19841d1752f7ec364098333429ce090374e79cd
Closes-bug: #1263537
2013-12-23 13:12:12 +00:00
Yanis Guenane
70cb81e929 Make Glance code base H201 compliant
Add Exception to all except without any specific exception
class so the code can be H201 compliant

Change-Id: Ibd09e69f70c76837c72023ae87cbbe75c5eb1276
2013-12-23 00:38:52 +00:00
Dirk Mueller
2fb875f79f Fix and enable gating on H702
Formatting operations should be outside of localization,
otherwise translation lookup will never find a translated
string as a match. This also fixes H701 alongway.

Change-Id: I6708e0f5b11841b18ba9042ac4958643f91396dd
2013-12-11 22:12:11 +01:00
Victor Sergeyev
88bb1af1d5 Enable F40X checking
Clean up imports due to F401 and F403 checks.
F401  'module' imported but unused
F403  unable to detect undefined names with wildcard import

Change-Id: I487edb157de1a6babc7ad8a3fb65f195e476c490
2013-11-27 18:15:48 +02:00
Luis A. Garcia
1236af6039 Enable H501: do not use locals() for formatting
Change-Id: I8b63c76b50cb3bb74b136678a945df79eb19856e
2013-11-12 00:50:49 +00:00
Dirk Mueller
6ba3ebbf8d Start using PyFlakes and Hacking
Instead of globally ignoring Pyflakes and Hacking
warnings, blacklist explitly only those that trigger
numerously. Fix the rest alongway and start to gate
on those that are now passing.

Change-Id: Ia19dc708cf0ccab2da5b46d1652f16e901499c24
2013-11-05 14:23:53 +01:00
Monty Taylor
d0314c0973 Rename requirements files to standard names.
Change-Id: Icde92cdff054f8c1efb4a518ab7cf166a8eb791a
2013-07-30 00:34:26 -04:00
Chuck Short
a72b2d64b1 python3: Introduce py33 to tox.ini
Introduce py33 to tox.ini to make testing with
python3 easier.

Change-Id: Iddb14c65c0bf44612bdf8e301e31ab71ea432f29
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-01 16:49:31 -05:00
Monty Taylor
66b3e5ec83 Use flake8/hacking instead of pep8.
Change-Id: Ia99bc9116d7d8b558002b302cafe354d05d57f72
2013-05-03 11:28:22 -04:00
John Bresnahan
039f3d8a59 Convert scripts to entry points
The executable programs used by Glance have historically been scripts
in the ./bin directory.  This patch converts all of the scripts to
entry_points.  This change makes these programs python modules.  Thus
they can be imported and methods in them can be called just like any
other module.  This will allow the tests to call into these programs
directly instead of having to fork out a process.

The conf.py file in the doc tree was causing a name collision with
the python module cmd.  The glance/glance directory was being added
to sys.path which made glance.cmd import with the name cmd.  This
patch also fixes that problem.

blueprint: refactoring-better-faster-stronger-functional-tests
Change-Id: I67ae14b7403af31a5944befcd2ec27a690e81f15
2013-04-29 14:08:29 -10:00
Mark McLoughlin
98552376f3 Use oslo-config-2013.1b3
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-19 10:19:36 +00:00
Dan Prince
4039f3aa3c Make tox.ini run pep8 checks on bin.
This updates the pep8 checks in our tox.ini file so that we are
also scanning the bin directory.

Change-Id: I2c0520c1239fcbda6b5b70f2d20709b96b94a4c5
2012-11-09 12:58:50 -05:00
Mark Washenberger
54607f764d Clean up is_public filtering in image_get_all
Prior to this patch, is_public filtering was applied in a
counterintuitive and potentially dangerous manner. In particular,
is_public=True would return images where is_public=False. Also, in a
variety of cases (that weren't exposed in the http api) users could list
private images that they do not own. This patch fixes those problems by
making is_public filtering work the same as any other filter and adding
separate visibility restrictions that always apply to list queries. To
preserve the existing behavior of the v1 api where admins by default do
not see all private images, admin contexts are deescalated to normal
contexts in certain situations.

With this change, pep8 ignores E712 because it is normal to use
"column == True" in sqlalchemy.

Fixes bug 1060481.
Fixes bug 1061331.

Change-Id: I086bd9273e337ebe184902b6f12bc8c9a7fc5867
2012-10-23 15:39:18 -07:00
Rainya Mosher
1a20651030 Setup the pep8 config to check bin/glance-control
Fixes bug 1067518.

Change-Id: I01abbf9571f303b5d20739312300a2f6b9d5a7b7
2012-10-16 14:30:32 -07:00
Zhongyue Luo
cb64f58b99 Clean up pep8 E128 violations
Fixed E128 errors
All ignores are to be removed in the next sequence of patches

Change-Id: I3ccff7df8c382f83ae6aa9aa6a7f16324c3aec75
2012-10-09 10:04:19 +08:00
Zhongyue Luo
c05dd1c819 Clean up pep8 E127 violations
Fixed E127 errors.
All ignores are to be removed in the next sequence of patches.

Change-Id: I56839ebe63dbccbb830dfed8923892c7c0837d7e
2012-09-29 19:01:21 +09:00
Zhongyue Luo
305a9c12b5 Clean up pep8 E124 violations
Fixed E124 errors
All other ignores are to be removed in the next sequence of patches

Change-Id: Ic96ebf5dff645dfdc47478beeb6965d6ad266243
2012-09-24 09:32:11 +08:00
Zhongyue Luo
9f9f22cd80 Clean up pep8 E122, E123 violations
Fixed E122, E123 errors.
All other ignores are to be removed in the next sequence of patches.

Change-Id: I4b3edd9d1b2804ea7de255136da01b19f32abe1c
2012-09-19 16:41:51 +08:00
Zhongyue Luo
ba3d3728d1 Clean up pep8 E121 violations
Fixed E121 errors.
All other ignores are to be removed in the next sequence of patches.

Change-Id: I5d3f490a1bfbe1945a23a7fc1f38d818c0650ff7
2012-09-19 14:55:02 +08:00
Zhongyue Luo
f071f07795 Clean up pep8 E502, E711 violations
Updated pep8 version requirement to 1.3.3.
Fixed E502 and E711 errors.
E711 is ignored because of sqlalchemy statements.
All ignores are to be removed in the next sequence of patches.

Change-Id: I27155166a60be14521d958e1cc7c06ebcc90f1fd
2012-09-18 10:10:01 +08:00