Provides command line support for image-create, image-update,
and image-upload using the Glance V2 API. This includes building
help text for create and update based on the image jsonschema
as fetched from the server.
Also fixes bug caused by default warlock patch generation not
matching what Glance expects when updating a core property
which had not originally been set when the image was created.
Related to bp glance-client-v2
Change-Id: I841f9e3d05802f4b794cb6f4849abe03ff0324d9
This patch is for fix bug 1208784. In openstack ipv6 environment,
if the os image url is not provided, need use the provided host
to generate literal ipv6 image url.
Fixes bug 1208784
Change-Id: Icb71241a639db02d079348f086bd7bd5f0412609
When an error with non-ascii characters is caught by glanceclient, it
fails at printing it and exists with a UnicodeEncodedError. This patch
encodes errors' messages using strutils before sending them to stdout.
Fixes bug: #1200206
Change-Id: I4dabcd76ffb258840bd6a66ad23c030f34960e86
Instead of globally ignoring pyflakes and
hacking warnings, only blacklist those that trigger
very frequently so far, in order to clean them
up in followup commits. Fix and start gating
on the rest already.
Change-Id: Ied7c7250061e3bf379e8286e8ce3b9e4af817faf
Glanceclient implemented both functions before they landed into oslo.
Since both functions are already in oslo, it is now possible to pull
them in.
There's a small difference between glance's implementation and oslo's,
that is the later does not convert non-str objects - int, bool - to str
before trying to decode / encode them. This patch takes care of that
where necessary, more precisely, while encoding headers before doing a
new request.
Fixes bug: #1172253
Change-Id: I9a0dca31140bae28d8ec6aede515c5bb852b701b
Some mechanical translation of the deprecated
except x,y construct. Should work with Python >= 2.6
just fine
Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
Currently a KeyboardInterrupt can be triggered by the user while the
client is communicating with keystone. This patch moves the trap
higher up in the stack.
Fixes bug: 1157905
Change-Id: I16889c2d97bc4694ab27c863c62c27333e264b60
When a user attempts to terminate the CLI with CTL+C a stack
trace is printed to the screen. When downloading files the
partial amount downloaded will not be cleaned up. In most
cases the user redirects to stdout, thus this program cannot
clean that up.
Fixes Bug: 1130390
Change-Id: If9f8ffc72b422d5dbd5969eecde8904238dd8860
Currently glanceclient doesn't support non-ASCII characters for images
names and properties (names and values as well). This patch introduces 2
functions (utils.py) that will help encoding and decoding strings in a
more "secure" way.
About the ensure_(str|unicode) functions:
They both try to use first the encoding used in stdin (or python's
default encoding if that's None) and fallback to utf-8 if those
encodings fail to decode a given text.
About the changes in glanceclient:
The major change is that all inputs will be decoded and will kept as
such inside the client's functions and will then be encoded before
being printed / sent out the client.
There are other small changes, all related to encoding to str,
around in order to avoid fails during some conversions. i.e: quoting
url encoded parameters.
Fixes bug: 1061150
Change-Id: I5c3ea93a716edfe284d19f6291d4e36028f91eb2
* Rename --ca-file to --os-cacert (--ca-file deprecated for
backward compatibility)
* Add cacert to keystoneclient initialization to verify the
keystone server certificate
This aligns glanceclient with keystoneclient for option naming
and the use of TLS for the keystone auth connection. It does not
change the use of TLS/SSL for the glance connection.
Change-Id: If8b05655aea5f3c62612d77bf947dd790f77eddf
Standardize pep8 to 1.3.3 and cleared up any errors
found by pep8 tests.
Change-Id: Ib7eb97d0789556d1676ccad58b5d3364065b7d15
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Connect the --os-region-name option passed through the CLI
to the call to service_catalog.url_for.
Fixes bug 1080739.
Change-Id: I2d19d62a999a82a91de3883db12bbc24e900de25
Use pyOpenSSL for HTTPS connections.
This allows:
* Neater loading of system CA files
* Optional disabling of SSL compression
The performance gain from disabling SSL compression is significant
in cases where the image being uploaded/downloaded is in an already
compressed format (eg qcow2).
Related to bp ssl-connect-rework.
Change-Id: I0568b6c95c5fc7b8eafdbd0284e24c453660a55a
When SSL is being used and the --ca-file option is
not specified use an available system CA file to
verify the server's certificate.
Change-Id: Id5c9fda6fd9bd05cde3c2a9160a6e72cef086a44
This allows a user to pass a cert and a key to use in HTTPS
connections. The flags --cert-file and --key-file are added
to the CLI.
Addiionally, update the debug curl logging to print --cacert and
-k when ca_file and insecure are set.
Related to bp glance-client-parity.
Change-Id: Ibaea51419a903afb7939a6b5b848f7a6667893bf
This adds support for validation of ssl certs returned by remote
servers over SSL. The --ca-file param represents the CA cert used
to sign the remote server's cert. Use --insecure if the remote
server is using a self-signed cert or you don't have the CA cert.
Related to bp glance-client-parity
Change-Id: I45253a6e2d88da599addfcc464571e62ae920166
All legacy CLI commands should work as expected with a few
minor exceptions:
- no upload animation
- no interactive pagination
- help/usage output has changed
Deprecated options are indicated as such in their usage info. Deprecated
commands have descriptions that label them as such.
Related to bp glance-client-parity
Change-Id: I584b2447361967228bea332e14880e18db12fca8
Previously, both --os-auth-token and --os-image-url had to be
provided in order for either of them to be used in any API requests.
This breaks the tie between them and allows a user to override
either the auth token or the endpoint returned by Keystone independently
of one another.
Fixes bug 1029586
Change-Id: I8b81be723286c546d9cbd97c8b7d7aa89c03b2d4
The --debug argument has been ignored since httplib2 was replaced
with httplib. This re-enables the --debug flag as an equivalent
to the env var GLANCECLIENT_DEBUG.
Fixes bug 1030700
Change-Id: Ib653049eea2f18c4cc2f8f8aac7884245afd0f04
* This allows us to send truly chunked responses to users
* Handle bad connection url schemes with a new InvalidEndpoint exception
* Fixes bug 1023240
Change-Id: I34500987f51d4e0c6e1f89ecf93853de3fcbb1c3
* Consumers of this client should not depend on being able to import
any module other than glanceclient and glanceclient
* The only attributs of the glanceclient module are Client
and __version__
* The attributes of the glanceclient.exc modules have yet to be
locked down
* glanceclient.common.exceptions was replaced with a placeholder
module until consumers of it are updated
Change-Id: Iea9648cd06906d65764987c1f2ee5a88ebeee748
Create a --timeout option to allow users to provide a custom timeout
for requests from the command line. The timeout functonality already
exists in both v1 and v2 client classes.
Related to bp glance-client-parity
Change-Id: Ic91de5eae2824b37f6aad3adc5fda28b9674250e
Update the glanceclient CLI to support both underscores and dashes.
Dashes are prefered and show up in help.
This will hopefully keep the CLI more consistent with the other
OpenStack client projects like Nova, Swift, Keystone in addition to the
old Glance client which all seem to prefer underscores to dashes.
Fixes LP Bug #1018467.
Change-Id: I80d7a19f94033554f7f639166911726de4a5159f
Bug: 993993
* glanceclient/shellp.py
OpenStackImagesShell.get_base_parser(): Parse --os-endpoint-type
argument. Default to one defined in os.environ.
OpenStackImagesShell._authenticate(): Define endpoint type based
on command line argument. Use 'publicURL', if it's not specified
in command line and also not defined in os.environ.
OpenStackImagesShell.main(): Pass this value to authenticate.
Change-Id: I0c0cde5212198eec2a7d75fb2a7cad1cde048c7c
This only allows you to run image-list, but sets up a framework
that we can use to fill in the rest of the v2 functionality.
* Related to bp glance-client-v2
Change-Id: I8827e36fdcf79fe402990a6d05898ec00cbd54c6
This client includes the API version in the URL directly where the
former practice was to include it in the service catalog endpoint.
This change removes the version from the last component of the
SC endpoint (if present) for transition purposes.
Note that this does not generalize to the other APIs
where the version is not the last component of the SC endpoint.
Change-Id: Ie04c38d80b17a171482e195aa1c633b6b6974042
Copied mostly from python-keystoneclient with
some Glance-specific stuff. README.rst shows what
WILL be the way to do things, not what is currently coded :)