The only reason netaddr was pulled in was for ip validation routines
which exist in oslo.utils. Use those instead.
Change-Id: Ic3beee7e8bfb2b2d16ecac9be6322fe2704c70bd
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
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>
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
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
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
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
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
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>
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
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
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
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
Enable F841 check: local variable 'name' assigned but never used.
Make appropriate changes to files listed below.
Change-Id: I02837d4abf421dc9d85f3b01587120fd68acfa12
* 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
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>
Enable H202 check: assertRaises Exception too broad.
Make changes to glance/tests/unit/test_notifier.py
Change-Id: I258367172e77312ddda06132d2e8371e8fff81e7
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
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
* H233 use of print operator
* H301 one import per line
* H302 import only modules
Change-Id: I752c3c117e2575b30cc96d68c18df365d595588e
Closes-bug: #1263535
Add the Apache headers where it was missing so the Glance
code base can be H102 compliant
Change-Id: If19841d1752f7ec364098333429ce090374e79cd
Closes-bug: #1263537
Add Exception to all except without any specific exception
class so the code can be H201 compliant
Change-Id: Ibd09e69f70c76837c72023ae87cbbe75c5eb1276
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
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
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
Introduce py33 to tox.ini to make testing with
python3 easier.
Change-Id: Iddb14c65c0bf44612bdf8e301e31ab71ea432f29
Signed-off-by: Chuck Short <chuck.short@canonical.com>
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
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
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
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