Cleanup a handful of places where named loggers are created for a
particular module but aren't used consistently. Also fix a couple
of log entries that aren't internationalized
Change-Id: I38186d47e7f31626b3ead779707d8ee5a15f56ac
Fixes bug #925166
This patch for packages which have few backslash continuations.
Follow up patches will be for packages network, scheduler, virt,
db/sqlalchemy, tests, and api/openstack.
Change-Id: I4200010b47b33fa8b9115b5d379b543200f6668d
Recent changes broke support for the --flagfile argument. It would attempt
to find the argument and then pull off the filename portion, but it would
only skip one letter, instead of the full argument name. The resulting
error would be:
Change-Id: Ic252b0c778774a7ea3e24a9ed8b182deb5987f65
OSError: [Errno 2] No such file or directory: 'lagfile=../nova.conf'
* Adds a rootwrap filter to limit readable files
* Adds a utils method to read a file as root
* adds tests to verify the additions work
Change-Id: Ic1ffb6f72f9b73795d5f39fac719842e6bdf16dd
Having to manually sudo to the nova user to make things work is
tedious. Make it so that if we can't read the conffile, we just
re-exec under sudo.
Fixes bug 805695
Change-Id: I322cece80ca757c69147fb3f8474ad137d9bff82
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
Phase 1 of the image-cache-management blueprint. Implement
checksumming and verification of base images, as well as
removal of base images which are not in use. Removal is
enabled with a flag.
Change-Id: Ib04a02075a103c2fef6716fd0ac87c41a3535d37
File locks in nova have a bad habit of lingering if the process that
created them is killed, and there isn't a good automated way to fix this
behavior. This option allows a deployer to avoid the problem if they
know they are only running a single nova process on a machine.
Change-Id: I1ae20cc54a4614b200093ffd581d3ab21d7c241b
This will allow us to support backends other than linux_net (i.e.
quantum L3 when it is available) for defining L3 connectivity.
Change-Id: I0b2ece2278bd68166741107a88cedd106d1ab651
get_instance_nw_info() now returns network model, and keeps the network
info cache up to date.
virt shim and translation in place for virts to get at the old stuff
Change-Id: I070ea7d8564af6c644059d1c209542d250d19ddb
Fix bug 906346.
This patch addresses the typo pointed out in bug 906346. The ping being
sent was 15 bytes long when it should have been 14. Removing a pad byte
from the format string resolves this issue. I verified that the format
described in the code comments (and now the code) was correct using an
OpenVPN connection setup packet capture.
Change-Id: Idbc5e48ede4a8d2836dd1b102a9a0e172540776c
Fixes bug 884825. The bug was pointing out some unused variables
noticed by pylint.
utils.runthis() was only used in one place and doesn't really provide
much value over utils.execute(), so just remove it.
Change-Id: I3dcc34bd840a128418b58a8a66acb62adf3fc9cc
1. Provides dom0 IPtables driver to implement the Provider firewall rules.
2. Existing libvirt code has been refactored to reduce the amount of duplicated code to a minimum
3. The three provider apis in ec2/admin.py file are now fixed the following way:
a. remove_external_address_block returned 'OK' on removing blocks which didn't exist. This is now fixed.
b. block_external_addresses raised exception earlier on duplicate network blocks. Now the exception is logged and failed status message is returned.
c. all the three provider apis now logs for invalid and improper inputs and return uniform (a dictionary ) and proper status messages for all cases.
4. appropriate unit tests added to cover the same
Change-Id: I27d83186f850423a6268947aed0c9a349d8f8d65
Implements blueprint disk-configuration-parity
This change splits local_gb into root_gb and ephemeral_gb. libvirt
interpreted local_gb as what ephemeral_gb is now, whereas XenAPI
interpreted local_gb as what root_gb is now.
Change-Id: I496600991bac1e990326d4ded1607fee08209d68
The table represents the current state of compute nodes and will be
used by the scheduler when selecting a host.
Re: https://blueprints.launchpad.net/nova/+spec/scaling-zones
This is just the db & notification portion of the branch. The scheduler
portion is being deferring until comstuds branch gets merged since it
conflicts heavily.
NOTE: Compute notifications are now two-part.
There is a compute.instance.XXX.start event and a compute.instance.XXX.end
message instead of the previous compute.instance.XXX event (which is
the same as the .end message)
Change-Id: Ia8e68680cb0924c59df84f2eec858febf4926d65
distributed scheduler isn't checking service_is_up or
services['disabled'] due to filters not having access to service.
Fixed both. Since ec2 API also uses service_down_time, I moved
service_is_up() into utils and made ec2 use it.
Change-Id: I0321844a47031b2de4d8738e032a4634edd1e945
Fixes LP853979
Remove the FK references for network data.
Remove unused db functions that used the FK's
Update db functions to not joinload
Update notification to optionally take network_info if compute has it
Update EC2 Api to use the network cache, falling back to rpc.call
Remove test_instance_get_project_vpn_joins which tests calls not used
Change-Id: I1a01ccc5ebcf7efeafe014af62be893325bb0825
This will allow us to mark deprecated classes and functions/methods as
such. A warning is issued each time a deprecated function/method is
called, or when a deprecated class is instantiated, or when any class
or static method on a deprecated class is called.
Change-Id: I4b5858492bc14768ac2e12c542bc343962761e34
* adds a boolean return representing whether file was reloaded
* ensures file is actually closed by using a context manager
Change-Id: I4d998c34caa6dde65aaf780c188778477b7f6753
ensure we are not fooled by capitalized names, by turning emails and names into lower cases before the matching.
Change-Id: Idbb8535174c0f1451ad6fd0628f35508f0f1e466
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
This adds a periodic task to cleanup erroneously running instances. The
impetus of the patch was a XenServer specific issue bug #911366, where deleted
instances would remain running on the host machine.
The patch however is hypervisor agnostic and is generally useful as a
housekeeping task to make sure these 'zombied' instances are detected.
Change-Id: Iddc6a88920a537a3a115f8b9bc0039ec0e24a194
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
Windows has a complexity requirement of at least three of these
criteria:
- one or more upper case characters
- one or more lower case characters
- one or more numbers
- one or more special characters
In some cases, the passwords generated didn't meet three of these four
critera. This change enforces that three of these criteria will be
met in the generated passwords.
Change-Id: Ibe0055b8830b426aee1c9b722cc2fae2f5db4c5c
Rather than providing two mutually exlusive image
access methods (loop and qemu-nbd), try each in turn.
This is to prepare for a follow up patch which will
add libguestfs as a method to try.
* nova/virt/mount.py: A new Mount class to abstract the
devce allocation, partition mapping and file sys mounting,
for each access type.
* nova/virt/disk/loop.py: A specialization of the base Mount class
to provide loop back mounting support.
* nova/virt/disk/nbd.py: A specialization of the base Mount class
to provide qemu-nbd mounting support.
* nova/virt/disk/api.py: A new file containing the nova.virt.disk
module interface.
(img_handlers): A new list of access methods to try,
with the order being honored.
(_DiskImage): An internal helper class that uses the plugin classes
above, to provide the operations available on a disk image file.
When mounting, iterate over each access method until one succeeds.
If a hint is provided about a CoW format image, the list of
methods to try will be reduced accordingly.
Note expected errors are no longer raised as exceptions during mounting.
Instead, on failure to mount an image, errors are collated and raised.
Interveining errors are logged in debug mode for successful mounts.
* nova/virt/libvirt/connection.py: Adjust the function parameter
names to be more general, rather than referencing specific
implementations like 'nbd' and 'tune2fs'.
Simplify the destroy_container() by storing and passing
back a reference to the _DiskImage object, which has the
necessary state to unmount.
* nova/utils.py (trycmd): A helper function to both deal with,
commands that issue ignorable warnings to stderr,
and commands that EXIT_SUCCESS while issuing errors to stderr.
nova/virt/xenapi/vm_utils.py: Adjust for the moved virt.disk package
Change-Id: If3a4b1c8f4e2f2e7300a21071340dcc839cb36d7
This patch uses the same logic from glance to verify if a UUID is
properly formed. It just tries to build a uuid.UUID from the string.
A test case has been added which previously would have failed, but now
passes.
A second test case has been added that verifies that the result of the
gen_uuid() function is considered valid, as well.
Change-Id: I33fe37b23ef03eda0f0e9d69afb601ca260aabde
The XML templates have been converted into properties, thus we can
compare the mtime of the XML templates (libvirt and cpuinfo) each
time they are needed, checking if they have been modified and
reloading them. Added a function to read cached files.
Change-Id: I6cf0229c6435300e73f9d9a6b10b0bf9bf144a55
Change utils.execute to accept a list or a single integer in
check_exit_code.
In libvirt.disconnect_volume() return codes 0 and 255 are both valid
for logout/delete, where 255 is returned if the volume is already
disconnected.
Change-Id: Icffeb0fe8269a02d95ac6ed180ba0bb9f458a6ed
Currently, we log it when we attempt to acquire a log, but we don't
mention it when we succesfully do acquire it. This makes people think
it's stuck.
This patch logs the succesful acquiry of locks.
Change-Id: I3b49ff331641ceafa46c93d8f5233c85fe45e5e2
Updated hostname sanitization method to more closely follow RFC-952
and RFC-1123. Also moved it to nova.utils, where it seems to fit
better.
Fixes bug 885374
(Patch Set 1) Updated hostname sanitization with more efficient and
[opinion] more readable implementation.
Change-Id: I60d7ee89867c05950bec1fd53b072a1c6247ebea
Introduced various sanity checks before adding security group rule
into the database. The checks have been implemented both in EC2 and
openstack extension code.
Implemented the suggestions made in first patch by Brian
Fixed the unit tests in security groups
Fixed pep8 issues in security group unit tests
Fixes bug 869979.
Change-Id: I2ac28666e90e7bdeacb7b1c2676c0719cfb9e441
update: pep8, and fixing log output.
update2: more pep8, I'm looking at you vim
update3: more formating
update4: mailmap
update5: more pep8
Change-Id: I38617e14260e65ed5cb81b3554479d3720850aae