summaryrefslogtreecommitdiffstats
path: root/nova/image
Commit message (Collapse)AuthorAgeFilesLines
* Remove trivial cases of unused variables (1)Stanislaw Pitucha2013-06-131-4/+1
| | | | | | | | | | | Kill some of the variables marked as unused by flakes8. This should allow to enable F841 check in the future. Only trivial cases with no function calls and obviously pure functions (like datetime.now(), or len()) are cleaned up here. Part 1, split to reduce conflicts. Change-Id: I82854349574ec4bcb9336aba626eefdaed81a8c8
* Fix and enable H403 testsDirk Mueller2013-06-121-1/+2
| | | | | | Multi-line doc-strings should end on a new, separate line. Change-Id: I4cf0cfe92b634ef77971863a4df41ef43531bc20
* Merge "Fix EC2 RegisterImage ImageLocation starts with /"Jenkins2013-06-051-2/+1
|\
| * Fix EC2 RegisterImage ImageLocation starts with /Avinash Prasad2013-05-281-2/+1
| | | | | | | | | | | | | | | | | | * Allows image location that begins with '/' during EC2 image register * Adds relevant unit test Fixes LP bug #1074908 Change-Id: I488b126c2079de4370823b347e80c7ec1ecc2c9f
* | Merge "Improve Python 3.x compatibility"Jenkins2013-06-051-3/+3
|\ \
| * | Improve Python 3.x compatibilityDirk Mueller2013-06-011-3/+3
| |/ | | | | | | | | | | | | | | | | Mechanical translation of the deprecated except x,y: construct with except x as y: The latter works with any Python >= 2.6. Add Hacking check. Change-Id: I845829d97d379c1cd9b3a77e7e5786586f263b64
* / _s3_create handles image being deletedChris Yeoh2013-05-301-64/+69
|/ | | | | | | | | | Change so _s3_create handles the image it is creating being deleted while it is creating it without logging a stacktrace and instead just logging a simple message explaining what happened. Fixes bug 1084703 Change-Id: I9d984dd1cf4f393010493cacd048d20ad5225db8
* Convert to using oslo's execute() method.Michael Still2013-05-041-1/+2
| | | | | | | | There are some small warts (mostly around other execute() like methods which reuse the exception). I will fix these warts in later reviews. Change-Id: Ice9cdbdc5f3e5a9f8365f5d99acf1863a9fe3e7a
* Merge "Catch glance image create exceptions"Jenkins2013-05-011-2/+5
|\
| * Catch glance image create exceptionsChris Yeoh2013-05-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Catch exception from glance when image creation fails because the requested name is too long. Currently the exception is not caught in the api which results in an 400 Bad Request correctly being returned, but also leaving a traceback in the logs. Correctly catching the exception and explicitly raising an HTTPBadRequest removes the production of the traceback. Fixes bug #1169560 Change-Id: I511da79cb0b1b4578bf43f0819b2ac64fb6e5fb3
* | Map internal S3 image state to EC2 API valuesChris Yeoh2013-04-181-0/+16
|/ | | | | | | | | | Fixes the EC2 API so it maps internal S3 image state values to ones defined by the EC2 API rather than returning the internally used values. Fixes bug #1074904 Change-Id: Iabbda0e5fcbe4d572c76367c6f98d4bece050e73
* Update OpenStack LLC to FoundationKurt Taylor2013-02-261-1/+1
| | | | | | Update all references of "LLC" to "Foundation". Change-Id: I009e86784ef4dcf38882d64b0eff484576e04efe
* Use oslo-config-2013.1b4Mark McLoughlin2013-02-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.1b4 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. Add dependency_links to setup.py so that oslo-config can be installed from the tarball URL specified in pip-requires. 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. Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already does for paste. It turns out imp.find_module() doesn't correct handle namespace packages. Retain dummy cfg.py file until keystoneclient middleware has been updated (I18c450174277c8e2d15ed93879da6cd92074c27a). Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
* Merge "VMware Compute Driver Glance improvement"Jenkins2013-02-011-4/+7
|\
| * VMware Compute Driver Glance improvementSean Chen2013-01-241-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | blueprint vmware-compute-driver Glance change to fix image download to ESX The current glance code downloads files in a blocking/synchronous manner, the fix improves it to work with ESX glance file reader in a non-blocking manner. This allows ESX glance file reader to read items from the returned queue. Change-Id: I05ab7ac00878aeeea3bbcd7546b05398f2630dd3
* | Add debug log when call out to glanceJoe Gordon2013-01-241-0/+2
|/ | | | | | Calling out to another service may take a while, so lets log this Change-Id: I223105ee578ae82230cbc3936c096e148b07e8f1
* Merge "Directly copy a file URL from glance."Jenkins2013-01-211-1/+19
|\
| * Directly copy a file URL from glance.John Bresnahan2013-01-181-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That patch allows nova to use shutil to copy a file directly from the glance store. For this to work glance needs to enable direct_url descriptions in the image metadata. This is done by setting show_image_direct_url to True in glance-api.conf. The path used to back glance also must match the path used to back nova instance storage. This should be a large performance increase for the cases where both glance and nova instance storage are backed by a shared file system like gluster or ceph. A new option has been added to nova: allowed_direct_url_schemes This option is set to a list of schemes that can be directly accessed. For this first simple patch only file:// is valid, and the implementation is simple and inline. In the future it would be better to make this into propagation modules which are dynamically loaded according to the scheme. DocImpact Implements: blueprint direct-file-copy Change-Id: I041b5524f8a0ea59e89ece0202f0503abf2f9d8e
* | Merge "Move global service networking opts to new module"Jenkins2013-01-102-2/+2
|\ \
| * | Move global service networking opts to new moduleMark McLoughlin2013-01-092-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | The my_ip, host and use_ipv6 options are used all over the codebase and they're pretty well related to each other. Create a new netconf module for them to live in. There are now no options registered globally in nova.config! blueprint: scope-config-opts Change-Id: Ifde37839ae6f38e6bf99dff1e80b8e25fd68ed25
* / fix N402 for rest of novaSean Dague2013-01-092-3/+3
|/ | | | | | | fix N402 (single line docstrings should end in a period) for rest of nova files Change-Id: I57d0d9ab01345dd83e544e476d79d2c2ca68ee51
* Move global s3 opts into nova.image.s3Mark McLoughlin2013-01-081-2/+8
| | | | | | | s3_host and s3_port are only used in nova.image.s3. blueprint: scope-config-opts Change-Id: Ia841406ebe7c03b2a58392e2453118e2646ad7ce
* Move global glance opts into nova.image.glanceMark McLoughlin2013-01-081-0/+22
| | | | | | | | | | | | Move the glance_host, glance_port and glance_protocol options into the nova.image.glance module. Also move the generate_glance_url() and generate_image_url() utility methods there since they're the only uses of the options outside of the module. blueprint: scope-config-opts Change-Id: I3beca1a65cdd902a94ddc1c512d79a4de635ef38
* Traceback when user doesn't have permission.Chuck Short2012-12-181-0/+3
| | | | | | | | | | When a user tries to access an image that is forbidden it sends an HTTPForbidden. Inform the user with a help message that the permission is not available to them. Change-Id: I3082c789876440226b5f177216ec628436c7b3ce Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Move some options into nova.image.glanceMark McLoughlin2012-12-111-3/+15
| | | | | | | | | The glance_api_servers and glance_api_insecure options are only used in nova.image.glance. The only other place that glance_num_retries is used is nova.virt.xenapi.vm_utils. blueprint: scope-config-opts Change-Id: I2cd0f62e43379bc94c95f85ab5b4aac9faf6c4f7
* Move api_rate_limit and auth_strategy to nova.apiMark McLoughlin2012-12-111-1/+1
| | | | | | | | | api_rate_limit is only used in nova.api.auth and auth_strategy is only used in one other place. Scoping both options to nova.api.auth makes their purpose more clear. blueprint: scope-config-opts Change-Id: I03f35c0e38239ecd96e8c304527530d42ab4097e
* Use CONF.import_opt() for nova.config optsMark McLoughlin2012-11-202-2/+6
| | | | | | | | | | | | | The only reason for importing nova.config now is where one of the options defined in that file is needed. Rather than importing nova.config using an import statement, use CONF.import_opt() so that it is clear which option we actually require. In future, we will move many options out of nova.config so many of these import_opt() calls will either go away or cause a module other than nova.config to be imported. Change-Id: I0646efddecdf2530903afd50c1f4364cb1d5dce1
* Remove nova.config.CONFMark McLoughlin2012-11-202-2/+3
| | | | | | | | | | | | | | | Modules import nova.config for two reasons right now - firstly, to reference nova.config.CONF and, secondly, if they use one of the options defined in nova.config. Often modules import nova.openstack.common.cfg and nova.config which is a bit pointless since they could just use cfg.CONF if they just want to nova.config in order to reference CONF. Let's just use cfg.CONF everywhere and we can explicitly state where we actually require options defined in nova.config. Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
* Remove nova.flagsMark McLoughlin2012-11-172-2/+0
| | | | | | | | Now that options have all moved from nova.flags to nova.config, we can safely remove the nova.flags imports and replace them with nova.config imports. Change-Id: Ic077a72dd6419bbf1e1babe71acfa43c4e8b55c8
* Switch from FLAGS to CONF in misc modulesMark McLoughlin2012-11-042-16/+18
| | | | | | | | | | | Use the global CONF variable instead of FLAGS. This is purely a cleanup since FLAGS is already just another reference to CONF. We leave the nova.flags imports until a later cleanup commit since removing them may cause unpredictable problems due to config options not being registered. Change-Id: Ib110ba8d1837780e90b0d3fe13f8e6b68ed15f65
* Merge "fetch_images() method no more needed"Jenkins2012-10-311-1/+1
|\
| * fetch_images() method no more neededÉdouard Thuleau2012-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nova Glance wrapper returns all images metadata if the parameter 'limit' is not define. It doesn't split the image metadata list. So the sub method fetch_image is no more needed. We can delete it. I added a check in Nova Glance wrapper to be sure the parameter 'marker' or another one aren't set to 'None' (like in bug #1065053). Fixes LP bug #1070904 Change-Id: I24ecc4adf158401f60b508aa3a20bd4c91bfa92b
* | Correct _extract_query_params in image.glanceMotoKen2012-10-261-2/+2
|/ | | | | | | | Updates _params rather than params to ensure filters. Fixes bug 1070138. Change-Id: I4e71d19f120ea91d8dfca32785ccb0aa7b1c770b
* add get_location method for imagesJosh Durgin2012-09-181-16/+36
| | | | | | | | | | | | | | | | | | | | This is useful for determining whether the backend storage for the image in Glance is the same as the storage used in a volume driver. The direct_url is only available in the v2 images API, so add a version parameter to each request. As more parts of the v2 API are used, this parameter will become more useful. Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Conflicts: nova/image/glance.py This is based on a cherry-pick of cinder commit 171a57a6879683dac5f219a0e8f1080ea687105d Change-Id: I5ca06b6d80ffe4118f8dd381ed11283573bce71f
* Allow connecting to a ssl-based glanceVincent Untz2012-08-271-13/+29
| | | | | | | | | | This introduces a new glance_api_insecure setting that can be used to not verify the certificate of the glance server against the certificate authorities. Fix bug 1042081. Change-Id: I0a9f081425854e9c01e00dfd641e42276c878c67
* Make glance image service check base exception classesChris Behrens2012-08-211-12/+12
| | | | | | | | | | | | | Fixes bug 1039675 glanceclient can raise HTTPNotFound (as well as NotFound) it appears, but glance image service is only converting NotFound -> InstanceNotFound. Same applies to 'Forbidden' and other exceptions. This patch converts 'exc_type is NotFound'-like checks to use 'isinstance' instead, which will cover HTTPNotFound, etc. Change-Id: I0982875e667121cee3da3cfe0124499cad484fa6
* Rewrite image code to use python-glanceclientBrian Waldon2012-08-132-116/+72
| | | | | | | | | | | | | | This patch rewrites the Glance-specific code within Nova to use the new python-glanceclient library. The old client is deprecated in Folsom and should not be used in conjunction with python-glanceclient. This removes the dependency on installing 'glance' through pip. Implements bp integrate-python-glanceclient Fixes bug 880964 Change-Id: Ifb9e75593abd36a2d1c08773d02f192e5e5627fc
* Fix traceback when using s3.Chuck Short2012-08-011-2/+2
| | | | | | | | | | | | | | | | | | Fix a regression that causes tracebacks in s3 Traceback (most recent call last): File "/opt/stack/nova/nova/image/s3.py", line 294, in delayed_create _update_image_state(context, image_uuid, 'downloading') File "/opt/stack/nova/nova/image/s3.py", line 286, in _update_image_state headers) TypeError: update() takes at most 5 arguments (6 given) This is due to 6e4539f397bfc5dbf9ec88ddc3968621815d576b Fixes LP: #1031867 Change-Id: I6cf786999c623c0ca780a173dcba49354207e9c3 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Tidy up nova.image.glanceBrian Waldon2012-07-301-36/+14
| | | | | | | | | | * Add comment explaining relevance of _is_image_available * Drop superfluous log statements * Drop GlanceImageService.delete_all as it has never been implemented * Drop the 'features' kwarg for GlanceImageService.update * Code simplification Change-Id: Ie538dd93dec729fb060bbcddfbddcba6cf303e52
* Use common parse_isotime in GlanceImageServiceBrian Waldon2012-07-301-17/+1
| | | | | | | Rather than reimplement openstack-common's isotime functionality, just use what's provided for us! Change-Id: Id44eab3c34ae2c682d27d1563c6baaf68b979d2b
* Refactor glance image service codeChris Behrens2012-07-261-91/+91
| | | | | | | | | | | | | | | | Fixes bug 1029397 This adds better retry support, making sure that if we need to retry requests to glance, we cycle through all hosts before potentially attemping the hosts that failed. The old random selection could cause immediate retrying of the same host that failed. This also adds logging of the host:port that failed and fixes a bug in the retry test, which didn't actually successfully test retrying. Tests for new code added. Change-Id: I400616081e1e547b9ca2e0be622889d3a399a5bf
* Remove deprecated auth from GlanceImageServiceBrian Waldon2012-07-111-17/+0
| | | | | | | | | | * Drop the code block specific to deprecated auth in image deletion code * Remove reference to deprecated auth in the auth_strategy config option help text * Related to bp remove-deprecated-auth Change-Id: Id0f4f287d33d01d54642fbc544ada9b7ef1b83ec
* Switch to common logging.Andrew Bogott2012-07-022-2/+2
| | | | | | I only just moved logging from nova to common, so behavior should remain the same. Change-Id: I1d7304ca200f9d024bb7244d25be2f9a670318fb
* Merge "Clean up cruft in nova.image.glance"Jenkins2012-06-291-18/+12
|\
| * Clean up cruft in nova.image.glanceBrian Waldon2012-06-281-18/+12
| | | | | | | | | | | | | | * Directly import glance.client rather than through importutils * Arbitrary code cleanup (spacing, comments, etc) Change-Id: I27410e5e37bcb010e68c964fbdb6d2e46608cc87
* | Rename GlanceImageService.get to downloadBrian Waldon2012-06-271-4/+1
| | | | | | | | | | | | | | | | In preparation for integration with the new Glance client, this drops the return of image metadata from GlanceImageService.get in addition to renaming it to 'download'. Change-Id: I75ca3a0a909335e74cd521da6f894c163e773e94
* | Remove GlanceImageService.index in favor of detailBrian Waldon2012-06-272-21/+0
| | | | | | | | | | | | | | | | | | Since there is no difference in index vs detail in the v2 API, let's drop that as a requirement in the GlanceImageService. Related to bp integrate-python-glanceclient Change-Id: If98cf68e7e18fa78a2f9c09526ca9e80d2e27c1b
* | Remove image service show_by_name methodBrian Waldon2012-06-272-14/+3
| | | | | | | | | | | | | | | | | | This method isn't worth keeping around. It's used in one place and consists of a try/except block. We also shouldn't encourage clients of GlanceImageService to depend on finding a single unique image by a non-unique attribute. Change-Id: I02347adef7bc7ac70407226ea150000e55a798bc
* | Cleanup of image service codeBrian Waldon2012-06-274-313/+30
|/ | | | | | | | | | | | * Remove image_service flag * Move nova.image.fake to nova.tests.image.fake * Move nova.image.get_default_image_service to nova.image.glance.get_default_image_service * Move nova.image.get_image_service to nova.image.glance.get_remote_image_service * Related to bp integrate-python-glanceclient Change-Id: Iea6db7898328a9060fb88586e042efbc0a4351fc
* Adds missing 'owner' attribute to image.MotoKen2012-06-271-1/+1
| | | | | | Fixes bug 1018216. Change-Id: I5540e0b8ab1df1904778e3edc250369b0930987e