summaryrefslogtreecommitdiffstats
path: root/nova/common
Commit message (Collapse)AuthorAgeFilesLines
* Switch to using memorycache from oslo.Vishvananda Ishaya2013-03-011-90/+0
| | | | Change-Id: I11ee70b36f06bc4a45b5ff207e53a331891a6bfa
* Flush tokens on instance deleteJohn Herndon2013-02-211-0/+5
| | | | | | | | | | | | | | | | | Force console auth service to flush all tokens associated with an instance when it is deleted. This will fix bug 1125378, where the console for the wrong instance can be connected to via the console if the correct circumstances occur. This change also adds a call to validate the token when it is used. This check will ensure that all tokens are valid for their target instances. Tokens can become scrambled when a compute node is restarted, because the virt driver may not assign ports in the same way. Change-Id: I0d83ec6c4dbfef1af912a200ee15f8052f72da96 fixes: bug 1125378
* Use oslo-config-2013.1b4Mark McLoughlin2013-02-191-1/+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
* Use oslo database codeEric Windisch2013-02-051-128/+0
| | | | | | | | | | | | | Bring in the new database code from oslo. Uses get_session() from oslo as well as changing NovaBase to derive from a common class. Remove test_sqlalchemy.py now that this code is test in oslo. Implements blueprint db-common. Change-Id: I090754981c871250dd981cbbe1a08e7181440120
* Fixes "is not" usageZhongyue Luo2013-01-311-1/+1
| | | | | | Fixes bug #1110973 Change-Id: I68451ce32f3036e43a2bf1f59a02b392a9e40d6d
* Move memcached_servers opt into common.memorycacheMark McLoughlin2013-01-091-0/+20
| | | | | | | | | | Add a factory function to nova.common.memorycache which consolidates the code to choose between real or fake memcache. This then means that memcached_servers is used in just one place and we can move the config option there. blueprint: scope-config-opts Change-Id: I67c191e0db58364eda4162b9e881606063509b9d
* Switch to using eventlet_backdoor from oslo.Matthew Treinish2012-11-161-83/+0
| | | | | | | | Instead of using the copy of eventlet_backdoor in nova.common this switches over to the synced version from oslo. Change-Id: Ice2e38b9da66b34e19f04af0a99bcdc2cb5b5cd3 Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
* Add support for backdoor_port to be returned with a rpc call.Matthew Treinish2012-11-141-3/+5
| | | | | | | | This adds an rpc call for compute and network that will return the eventlet_backdoor port for the service. Change-Id: I95fdb5ca9bce9f3128300e3b5601fb2b2fc5e82f Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
* Switch from FLAGS to CONF in misc modulesMark McLoughlin2012-11-041-4/+5
| | | | | | | | | | | 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
* sync deprecated log method from openstack-commonSean Dague2012-11-021-55/+0
| | | | | | | | | | the nova common deprecated util is now part of openstack-common log class as a deprecate method. Sync openstack-common and remove nova common util. All the deprecated pieces from folsom appear to have already been removed, so no additional code changes needed for this. Change-Id: I9cbd6a67c30567cd7002e8e7fec93cfc209787fc
* Implement paginate query use marker in nova-apipengyuwei2012-09-071-0/+128
| | | | | | | | | | | | | | | | | | 1.add limit and marker param to db.instance_get_all_by_filters() 2.set the filter use marker 3.execute limit before sqlarchmy get_all() 4.add testcase 'test_db_api.test_instance_get_all_by_filters_paginate' 5.related testcase: test_get_servers_with_marker() test_get_servers_with_limit_and_marker() in nova/tests/api/openstack/compute/test_servers.py test_instance_get_all_by_filters_paginate() in nova/tests/test_db_api.py 6.add InvalidSortkey exception Implement bp:efficient-limiting. Change-Id: Iea3eeb7b51194b6017d624506aafc6469d7338e4
* OpenStack capitalization added to HACKING.rstJoe Gordon2012-08-171-1/+1
| | | | | | Along with capitalization fixes to comments in code Change-Id: I72ddc582001f80d954ca5a121903c689f40d08d1
* Only log deprecated config warnings once.Dan Prince2012-08-051-1/+14
| | | | | | | | | | Updates Nova's deprecated warn function so that we only log messages about deprecated config options once. The motivation for this change is to cut down the log file noise when deprecated config code gets called more than once. Change-Id: If8919817330dc9461a0472fea982d43c78a86f66
* Switch to common logging.Andrew Bogott2012-07-021-1/+1
| | | | | | I only just moved logging from nova to common, so behavior should remain the same. Change-Id: I1d7304ca200f9d024bb7244d25be2f9a670318fb
* Merge "added deprecated.warn helper method"Jenkins2012-06-181-0/+42
|\
| * added deprecated.warn helper methodSean Dague2012-06-181-0/+42
| | | | | | | | | | | | | | provide a convenience method for indicating in code that a config option the operateor will have to deal with exists in their environment. Change-Id: I17b0c120d54b1db75c6bb29d107e4a15a5202e76
* | Replaces functions in utils.py with openstack/common/timeutils.pyZhongyue Luo2012-06-161-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | Fixes bug #1008628 1. Edit openstack-common.conf and import nova/openstack/common/timeutils.py 2. Move time related functions from utils.py to timeutils.py 3. Replace following functions in utils.py with timeutils.py - isotime - parse_isotime - strtime - parse_strtime - normalize_time - is_older_than - utcnow_ts - utcnow - set_time_override - advance_time_delta - advance_time_seconds - clear_time_override 4. Remove datetime related functions and datetime related unittests Change-Id: I9a92be286fb071b6237dd39495d88dae106e2ce0
* Make eventlet backdoor play nicer with gettextJohannes Erdfelt2012-06-071-1/+12
| | | | | | | | | Fixes bug 1010236 Implement a new sys.displayhook that doesn't overwrite __builtin__._ that was set by gettext Change-Id: Id3c0a331eb6f98240fe1e4d0b083c72e28f99c53
* Use openstack-common's policy moduleKevin L. Mitchell2012-06-041-222/+0
| | | | | | Reworks nova to use the new policy module in openstack-common. Change-Id: Iea8651bad85f26804285616330107d9d5f23e6cb
* Add eventlet backdoor to facilitate troubleshooting.Johannes Erdfelt2012-05-161-0/+69
| | | | | | | | | | This provides a FLAG to turn on Eventlet's builtin backdoor server which allows you to connect over telnet and receive a Python prompt (which is immensely helpful for debugging running systems). Fixes bug 1000366 Change-Id: I779247a0796d34ba2a5478436d85b30ba76c4a01
* improve speed of metadataJesse Andrews2012-03-121-0/+64
| | | | | | | | | | | | | | * don't load every possible answer, only do what is needed * cache instance data for a given address for a 15 seconds using either memcache or fake memcache (in-memory). This means only a single queue/db lookup for multiple calls to metadata service * add cache expirey to fake memcache (don't grow forever) and move it to nova.common.memorycache Addresses Bug #851159 Change-Id: Icf794156e055b18915b8b5be9ba2ab97d2338bbe
* fix restructuredtext formatting in docstrings that show up in the developer ↵Doug Hellmann2012-03-051-38/+53
| | | | | | | | | | | | | | guide blueprint sphinx-doc-cleanup bug 945160 - Correct parameter declarations, list formatting, cross-references, etc. - We don't need "let" in generate_autodoc_index.sh since we aren't doing math. - Change conf.py to not prefix class and function names with full namespace in generated output to save width on the screen. Change-Id: I9adc8681951913fd291d03e7142146e9d46841df
* Move cfg to nova.openstack.commonMark McLoughlin2012-02-031-1126/+0
| | | | | | | | | | | | | | | Move it here so that it can be kept in sync with openstack-common using the new update.py script for code in openstack-common's incubation area. See here for more details: http://wiki.openstack.org/CommonLibrary#Incubation Note: this commit just moves the existing code in Nova with no other changes. A subsequent commit will sync it with latest openstack-common so that it is easier see the new changes. Change-Id: If88d678b1b9bad3d37117de7f7159d7fea8ab4c8
* Ignore case in policy role checks.Dan Prince2012-01-271-1/+1
| | | | | | | | | | Update the default policy brain so that role checks ignore case. Fixes an issue where roles in keystone didn't exactly match the case of the role as specified in policy.json. Fixes LP Bug #922660. Change-Id: I05792755c9293e4dd80d642cb8eef6b0adda2ed4
* Add default policy ruleBrian Waldon2012-01-161-4/+9
| | | | | | If a specific rule is not found, we will check the rule defined in FLAGS.policy_default_action. Change-Id: Ib1b1aa4bbeec74bdb1562d0fc649d33838076f01
* Implements blueprint separate-nova-volumeapiAnthony Young2012-01-131-4/+4
| | | | | | | | | | | | | | | | * Moves openstack/v2 directory to compute and fixes tests accordingly * Moves some code from api/openstack/compute to shared location, for use by volume api * Implements basic volume functionality for types, volumes, and snapshots * Changes service name from osapi to osapi_compute (and adds osapi_volume) * Renames nova-api-os to nova-api-os-compute, adds nove-api-os-volume * Separate extension mechanism for compute and volume ** Removes flag osapi_extension and replaces with osapi_compute_extension and osapi_volume_extension * Updates the paste config * Fixes setup.py to include nova-os-api-compute and nova-os-api-volume * Fix bug in volume version code that occurred as result of trunk merge * Update integrated/test_volumes.py to use new endpoint Change-Id: I4c2e57c3cafd4e1a9e2ff3ce201c8cf28326afcd
* Add policy checks to Compute.APIBrian Waldon2012-01-121-3/+3
| | | | | | | | | * Second step of blueprint interim-nova-authz-service * Adds policy.json to define policy * Add nova.policy.wrap_enforce decorator * wrap majority of compute api functions with wrap_enforce Change-Id: If6702873db3249921f931a42e889ee7d0338e4b8
* Makes common/cfg.py raise AttributeErrorVishvananda Ishaya2012-01-111-1/+1
| | | | | | | * fixes bug 915039 * includes test Change-Id: I67b886be3b5af3763f52fffe54085975d61d61eb
* Adds simple policy engine supportVishvananda Ishaya2012-01-091-0/+202
| | | | | | | | | | * First step of blueprint interim-nova-authz-service * Common policy engine that can be used by other projects * Nova specific policy engine that uses common policy * Policy file can be generated by external tool (dashboard) * Ultimately, policies will be requested from a service Change-Id: Icaf934037e790bde6ce2346746ce38b11134423b
* PEP8 type comparison cleanuplzyeval2012-01-041-1/+1
| | | | | | | | | | | | | | | | Fixes bug #910295 The None, True, and False values are singletons. All variable *comparisons* to singletons should use 'is' or 'is not'. All variable *evaluations* to boolean should use 'if' or 'if not'. "== None", "== True", "== False", and "!= None" comparisons in sqlalchemy's where(), or_(), filter(), and_(), and select() functions should not be changed. Incorrect comparisons or evaluations in comments were not changed. Change-Id: I087f0883bf115b5fe714ccfda86a794b9b2a87f7
* PEP8 remove direct type comparisonslzyeval2012-01-031-2/+2
| | | | | | | | | | | | | | | | | | | | Fixes bug #910763 According to PEP8, - Object type comparisons should always use isinstance() instead of comparing types directly. Yes: if isinstance(obj, int): No: if type(obj) is type(1): When checking if an object is a string, keep in mind that it might be a unicode string too! In Python 2.3, str and unicode have a common base class, basestring, so you can do: if isinstance(obj, basestring): Change-Id: I7c0fdecf99872f5b8f72b2c2ed4f5c539c33def1
* Make cfg work on python 2.6Mark McLoughlin2011-12-081-1/+1
| | | | | | Issues spotted by eagle-eyed Kevin L. Mitchell. Change-Id: I5c2ae56dba645914e421411d4150165ce5bf5de6
* Add new cfg moduleMark McLoughlin2011-12-072-0/+1141
As discussed on the mailing list and described here: http://wiki.openstack.org/CommonConfigModule The module implements an API for defining configuration options and reading values for those options that a user may have set in a config file or on the command line. The module will be part of openstack-common and glance will consume it from there once openstack-common makes a release with an API compatibility commitment. Change-Id: Ib604c3de75d9066cd913c2de3007024b1f5ec9f8