Commit Graph

273 Commits

Author SHA1 Message Date
Jenkins 2a56a32edb Merge "Migrate to pbr." 2013-05-22 23:40:31 +00:00
Jenkins 52418e5dd1 Merge "Migrate to flake8." 2013-05-22 23:40:28 +00:00
Jenkins 985c06bea1 Merge "Improve unit tests for python-glanceclient.glanceclient.common.base" 2013-05-22 23:40:25 +00:00
Zhi Yan Liu 8c70c5b08d Convert non-ascii characters within image property to unicode
Convert non-ascii characters within image property (key/value pair) to
unicode but utf-8 to prevent provisioning failure when cloud using qpid
backend.
This change also make the image property encoding consistency between
the image updating and the receiving. Before this, image property
updating use unicode, but receiving (get) result is utf-8.

Fixes: Bug #1180377

Change-Id: I010760c598a7e008c79f1240255708265352cdb5
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2013-05-21 00:03:31 +08:00
Monty Taylor 4f9d4d051a Migrate to pbr.
Fixes bug 1179007.

Change-Id: I99d571bbf37ef53366a96de088c249cb6fd23b0e
2013-05-18 09:02:07 -07:00
Monty Taylor ca17541f33 Migrate to flake8.
Fixes bug 1172444.

Change-Id: Icec0820d0f780ed9473218b7e46e29c1e3db6541
2013-05-18 08:29:02 -07:00
Tatyana Leontovich 8451a94822 Add test for glanceclient shells
Add unittests for the following modules:
* glanceclient.shell
* glanceclient.v1.shell
* glanceclient.v1.legacy_shell
* glanceclient.v2.shell
Also add mock library to the tools/test-requires

Implements: blueprint glanceclient-shells-unittests
Change-Id: I5ec527c5efff3726932d234d7c67e08149643f89
2013-05-17 19:46:07 +03:00
Tatyana Leontovich ab36778ec3 Improve unit tests for python-glanceclient.glanceclient.common.base
Add several tests for glanceclient.common.base module

Fixes: bug #1144158
Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248
2013-05-15 17:59:43 +03:00
Jenkins de5f2eea02 Merge "Image Members for glance v2 api" 2013-05-10 17:07:43 +00:00
Jenkins 03a49e2da9 Merge "Expand HACKING with commit message guidelines" 2013-05-09 21:19:38 +00:00
iccha-sethi 18795f590a Image Members for glance v2 api
Lists, creates, deletes, updates image members using glance
v2 api.

Related to bp glance-api-v2-image-members

Change-Id: Ic018a265a1676bb0a5638a55e70a527ce6b447fc
2013-05-09 10:54:12 +00:00
Andy McCrae a3223b9972 Fix inconsistent --debug messages on image-update
image-update --debug message no longer adds '-d "None"' to the curl command that
is output. This keeps the curl output consistent with the client
request.

Fixes bug #1172702

Change-Id: I34ceeb6f4a67c753ca3a805ec11240a99ce38ec4
2013-04-27 13:48:57 +01:00
Alex Meade e750e9b0ed Expand HACKING with commit message guidelines
Add a 'Commit Messages' section to HACKING describing how a commit
message should be formed.

Change-Id: Ife0d6eab18cc0f07ad8e8c79cb2e4198513236d2
2013-04-26 15:26:14 -04:00
Jenkins addd3c3be3 Merge "Prevent WantReadError when using https" 2013-04-24 19:07:03 +00:00
Jenkins 4bbc7b8a9b Merge "Improve Python 3.x compatibility" 2013-04-24 16:38:25 +00:00
Stuart McLaren 2f33f5f283 Prevent WantReadError when using https
If the glance client is instantiated when the socket module has been
monkey patched requests to the server can yield a WantReadError because
the socket has been set to non-blocking but this is not being handled
correctly. When this is the case use eventlet's GreenConnection which
handles non-blocking sockets correctly.

Also, for now, add a required getsockopt method to GreenConnection.
This can be removed once the eventlet fix
(https://bitbucket.org/eventlet/eventlet/commits/609f230) lands.

Fixes bug 1157864.

Change-Id: I187b69f75b8bcfe16facd41e69b1cd0490dae605
2013-04-23 13:48:10 +00:00
Jenkins 42757e8a3c Merge "Test that copy_from is used properly in old API" 2013-04-22 23:33:46 +00:00
Jenkins 1b5c3231ec Merge "bug 1166263 image-update handling for closed stdin" 2013-04-22 20:11:10 +00:00
Dirk Mueller 45feb672af Improve Python 3.x compatibility
Some mechanical translation of the deprecated
except x,y construct. Should work with Python >= 2.6
just fine

Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
2013-04-22 16:38:55 +02:00
Davanum Srinivas e22d37d6f9 Sync with oslo-incubator copy of setup.py and version.py
Keep up with the changes to the master copy

Change-Id: Id938cc593a61b56a06c05069034bd958fc6aa8b3
2013-04-21 20:18:49 -04:00
Jenkins 11c2c40d46 Merge "Fix "glance add" parsing of "copy_from" option." 2013-04-22 00:05:29 +00:00
MattieuPuel 5ab88370d0 bug 1166263 image-update handling for closed stdin
handles the case where an image-update command is issued from a cron job with an
invalid standard input file descriptor: consider no image data is provided when
no --file option present.

Change-Id: I5eb3433311e5faf0a3fb7eb36f6a01e5df7efe4c
2013-04-16 14:34:58 +02:00
John Bresnahan 2178120e9a Test that copy_from is used properly in old API
This adds a test to verify that the copy from attribute is used
properly.  It tests for bug 1167899.  This submission depends on
the review here: https://review.openstack.org/#/c/26740/

Change-Id: Ied14fb29887b7cbbecbab51bd384cf0f640c9e18
2013-04-12 10:59:28 -10:00
Jakub Ruzicka c98432a6d4 Fix "glance add" parsing of "copy_from" option.
copy_from was ignored which resulted in "glance add" attempting to read from
stdout.

Fixes bug 1167899

Change-Id: I57fd85f7bb655bef69222d4fdf6b8274088ca827
2013-04-11 14:43:19 +02:00
Davanum Srinivas b0ce15be3e Fix problem running glance --version
__version__ should point to a string and not VersionInfo

Fixes LP# 1164760

Change-Id: I27d366af5ed89d0931ef46eb1507e6ba0eec0b6e
2013-04-05 09:48:25 -04:00
Tatyana Leontovich 0995045f2a Improve unit tests for python-glanceclient.glanceclient.common.http
Add several tests for glanceclient.common.http module

Fixes: bug #1149445
Change-Id: I6a47c64e11cefea276163777dcd559316fc8e0ad
2013-04-04 15:06:57 +03:00
Brian Waldon 741c15f963 Add docs for 0.9.0
Change-Id: Ic4645b8d83eec6577b67cc17d805c6b12b1bacda
2013-04-02 14:49:59 -07:00
Jenkins 6a8a66120c Merge "Filter images list by public=True|False" 2013-04-02 16:11:27 +00:00
John Bresnahan a8f7de2afd Filter images list by public=True|False
When running the image-list command the user should have the option
to list images according to whether or not the image is was set
to public.  A new test is included to verify this behavior.

Change-Id: If645e7390fcf850648cda780a04ea37a26d855a2
Fixes bug: 1118799
2013-03-30 21:26:35 -10:00
Jenkins 16208485bb Merge "Allow for prettytable 0.7.x as well" 2013-03-21 22:48:35 +00:00
John Bresnahan edf9ae5097 Trapping KeyboardInterrupt sooner.
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
2013-03-20 08:51:59 -10:00
Dirk Mueller 31960f0a85 Allow for prettytable 0.7.x as well
Relax requirements to >= 0.6, < 0.8, as 0.7.x seems to
work as well. Added testcase to ensure this.

Change-Id: I1a1a709e6053451b1256a0d78f8fe8562fb10e62
2013-03-15 17:38:04 +01:00
Jenkins c7c8e92e3c Merge "Implements filters: visibility, owner, member_status. Includes tests." 2013-03-12 14:43:23 +00:00
Jenkins 8787c82f11 Merge "Control C does not cancel the CLI cleanly" 2013-03-11 21:54:47 +00:00
Brian Rosmaita 552a68d2bf Implements filters: visibility, owner, member_status.
Includes tests.

Related to bp glance-api-v2-image-members

Change-Id: Ic48f54639fec4dc9b48819a8ffb1f0097001894c
2013-03-08 14:01:34 +00:00
James Li d810019d0e Add missing spaces in help msg
Change-Id: Ida1dcd9c75d1c36ea1b4bfefcd1d1292b565ab6b
2013-03-06 23:42:50 +00:00
John Bresnahan 1a3d40ccb4 Control C does not cancel the CLI cleanly
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
2013-03-05 12:12:03 -10:00
Jenkins 0ca43be6fd Merge "Use getattr properly in legacy shell" 2013-02-27 01:26:42 +00:00
Brian Waldon 8ec7468134 Replace SchemaNotFound with HTTPNotFound
Fixes bug 1131682

Change-Id: I615acbef0411677cae5d30262702babd900c0c81
2013-02-22 10:21:00 -08:00
Brian Waldon fbb858aa77 Use getattr properly in legacy shell
Fixes bug 1131703

Change-Id: If97f422af170c29785d2bf8884fafff979031e14
2013-02-22 10:15:50 -08:00
Jenkins 6c7fb0e46c Merge "Report name resolution errors properly" 2013-02-21 22:09:04 +00:00
Brian Waldon 51bbf74264 Add docs for v0.8.0
Change-Id: I86683a88466f96a8bd7e443c436b3bed19f5cfc4
2013-02-21 12:47:53 -08:00
Stanislaw Pitucha 7f7c9a1d85 Report name resolution errors properly
Errors in name resolution have been logged previously with the url path
rather than the hostname. That resulted in incorrect errors like:

InvalidEndpoint: Error finding address for
/v1/images/detail?is_public=none&limit=20: [Errno -2]
Name or service not known

rather than one mentioning hostname itself. This patch changes the log
message to fit the situation.

Change-Id: I1eecbcb22d41b1341c214937b9cbfd046fd301a0
2013-02-19 17:22:55 +00:00
Jenkins d831b5eb27 Merge "Decode input and encode output" 2013-02-18 18:58:14 +00:00
Jenkins 9f1cd2b16b Merge "Update to latest oslo-version." 2013-02-18 03:55:59 +00:00
Jenkins ed644d7228 Merge "Add library support for v2 image update" 2013-02-16 00:17:28 +00:00
Jenkins c994c3ec8b Merge "Expect minumum warlock version of 0.7.0" 2013-02-15 23:48:51 +00:00
Jenkins 541a560f02 Merge "Update .coveragerc" 2013-02-14 01:14:49 +00:00
Flaper Fesp 55cb4f4473 Decode input and encode output
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
2013-02-13 21:53:11 +01:00
Brian Waldon 00ba17965a Add library support for v2 image update
Related to bp glance-client-v2

Change-Id: Ia6fe16e462ce8827175577cbed8e15c326bf8ad3
2013-02-13 10:06:25 -08:00