Commit Graph

12 Commits

Author SHA1 Message Date
Erno Kuvaja 3068096199 Cleanup remove api v1 and registry code
Change-Id: I86a3cbf4374bc2b083ccd86f75b88490b305eaab
2020-07-14 10:38:19 +00:00
Lucian Petrut 98b7ef195c Allow glance tests to run on Windows
In order to run the unit and functional Glance tests on Windows, we
have to:

* avoid monkey patching the os module on Windows (which causes Popen
  to fail)
* update sqlite connection URL
* avoid os.fork, not available on Windows.
    * we'll use subprocess.Popen when spinning up http servers.
    * for the really simple ones defined in the test helpers, we'll just
      use threads
* do not attempt to connect to '0.0.0.0', use '127.0.0.1' instead
* some tests aren't properly skipped (xattr ones), so we're covering that
  as well
* skip log rotation test, we can't move in-use files. Log rotation can
  be performed by the log handler itself.
* expect an exception when hitting connection timeouts
* avoid installing unavailable test requirements (xattr, pysendfile)
* pin the instance creation timestamp. some tests that deal with
  markers rely on ordering, which can be flipped if the timestamps are
  identical (can happen in case of resources created one after the
  other, not sure yet if this happens really fast or the clock isn't
  accurate enough).
* add a few seconds to some timeouts (much needed when running the tests
  in VMs).

blueprint windows-support

Change-Id: Ife69f56a3f9f4d81e1e2e47fde4778efd490938f
2019-03-13 16:41:11 +02:00
kairat_kushaev c27c25f779 Import i18n functions directly
Import i18n functions from module directly and do not use
global module variables like _ = i18n._. It makes code shorter
and cleaner. It also to detect cases when these functions are not
used in module.

Change-Id: Iaa593ac1f2dd15cbcad049bef6ba68f1cfa610da
2015-12-07 18:20:43 +03:00
Louis Taylor 0acff569e0 Move to graduated oslo.log module
This removes the log module from the oslo incubator directory.

Change-Id: Ib017cc2777e27c58b376c3138c9fba614783cc34
2015-03-12 11:48:24 +00:00
Louis Taylor d759a6fd1a Move from oslo.config to oslo_config
oslo_config was moved out of the oslo namespace in oslo.config>=1.6.0.

Related-to: blueprint drop-namespace-packages

Change-Id: I30ecbf8f9de77496fcb643c7ad9738d79ad359f0
2015-01-12 14:34:22 +00:00
Nicolas Simonds 348cef70b9 Allow $OS_AUTH_URL environment variable to override config file value
Make the Glance APIs use this value in a consistent/expected manner
when it is set.  The Principle of Least Surprise dictates that
setting the value in the environment should override any values in
the config files.

Change-Id: Icdc39a2fd0da71a75f4ad0e60e34cfb8e1883787
Closes-Bug: 1314354
2014-12-20 05:50:58 +00: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
Stuart McLaren cc7ae2abd5 Make RequestContext use auth_token (not auth_tok)
The RequestContext class from oslo-incubator uses 'auth_token'.
Glance's RequestContext uses 'auth_tok' -- which is inconsistent.

glance_store currently uses the oslo 'auth_token'.

We should not assume a 1-1 mapping from the glance_store to glance,
nor should we have glance_store support both 'auth_token' and
'auth_tok'. Therefore Glance should be updated to use 'auth_token'.

This change was generated automatically with:

$ for file in `find glance -name '*\.py' -exec grep -wl auth_tok "{}" \;` ; \
  do sed --in-place 's/\<auth_tok\>/auth_token/g' $file ; done

In addition, the set_auth_token function was removed. This had been used
by Nova to work around the auth_tok <-> auth_token inconsistency, but
was removed in mid-2012 as part of the move to python-glanceclient so
is no longer needed.

In conjuction with other changes this fixes image upload when
using the multi-tenant Swift store.

Change-Id: Ic8a5f44088990fd8f6290a5622b823f59ef365fc
Partial-bug: #1385213
2014-10-28 15:39:21 +00:00
Noboru arai 8de10b0f34 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: I3b830a5bb831a63c188109e6fad66ba48884fff3
Partial-Bug: #1229324
2014-01-14 16:03:28 +00:00
Zhongyue Luo dbcc1b78ec Removes duplicate options registration in registry clients
Fixes bug #1204359

Change-Id: I5b8bd9e4465d9fe70e9311474bc2b00d9afcf046
2013-08-16 17:42:11 +00:00
Alex Meade be34808c7b Make passing user token to registry configurable
This patch adds CONF.use_user_token as a config option. When true, glance will
continue to use the user token when communicating with glance registry. When
false, glance will read admin credentials from the config and use those to
communicate with glance registry. Using admin credentials allow for
reauthentication when tokens expire and prevents requests from silently failing.

DocImpact
Fixes bug 1182536

Change-Id: Ia6b563677eb67d4069571c82b9dad3f025b6e9fb
2013-05-24 12:27:07 -04:00
Flaper Fesp 34135e88d5 Implement Registry's Client V2
The patch implements Registry's v2 Client.

Some notes:
* The implementation uses __getattr__ to map method's calls to remote
  RPC methods.
* The client supports both bulk and single calls.
* Client is based on the base HTTPClient

About Exceptions:
* If raise_exc == True, the client will try to re-raise the remote
  exception. If the server raised an unknown exception, it will be
  re-raised as RPCException in the client side.

Implements blueprint registry-api-v2

Change-Id: I98757c2272c68301373c1a3af96c4d06cb63cc97
2013-05-13 10:42:25 +02:00