Delete cached file if present.
Parameters: | filename – filename to delete |
---|
Delete a file, but ignore file not found error.
Parameters: |
|
---|
Create a directory (and any ancestor directories required)
Parameters: |
|
---|
Open file
see built-in open() documentation for more details
Note: The reason this is kept in a separate module is to easily be able to provide a stub module that doesn’t alter system state at all (for unit tests)
Read from a file if it has been modified.
Parameters: | force_reload – Whether to reload the file. |
---|---|
Returns: | A tuple with a boolean specifying if the data is fresh or not. |
Protect code that wants to operate on PATH atomically. Any exception will cause PATH to be removed.
Parameters: |
|
---|
Create temporary file or use existing file.
This util is needed for creating temporary file with specified content, suffix and prefix. If path is not None, it will be used for writing content. If the path doesn’t exist it’ll be created.
Parameters: |
|
---|
For example: it can be used in database tests for creating configuration files.
Bases: keystone.openstack.common.loopingcall.LoopingCallBase
A looping call which sleeps until the next known event.
The function called should return how long to sleep for before being called again.
Bases: keystone.openstack.common.loopingcall.LoopingCallBase
A fixed interval looping call.
Bases: object
Bases: exceptions.Exception
Exception to break out and stop a LoopingCallBase.
The poll-function passed to LoopingCallBase can raise this exception to break out of the loop normally. This is somewhat analogous to StopIteration.
An optional return-value can be included as the argument to the exception; this return-value will be returned by LoopingCallBase.wait()
Generic Node base class for all workers that run on hosts.
Bases: object
Launch one or more services and wait for them to complete.
Bases: object
Service object for binaries running on hosts.
Bases: object
Helper module for systemd service readiness notification.
Send notification to Systemd that service is ready.
For details see http://www.freedesktop.org/software/systemd/man/sd_notify.html
Send notification once to Systemd that service is ready.
Systemd sets NOTIFY_SOCKET environment variable with the name of the socket listening for notifications from services. This method removes the NOTIFY_SOCKET environment variable to ensure notification is sent only once.
Bases: object
Wrapper around a greenthread, that holds a reference to the ThreadGroup. The Thread will notify the ThreadGroup when it has done so it can be removed from the threads list.
Bases: object
The point of the ThreadGroup class is to:
Helpers for comparing version strings.
Bases: exceptions.Exception
Bases: object
A decorator to mark callables as deprecated.
This decorator logs a deprecation message when the callable it decorates is used. The message will include the release where the callable was deprecated, the release where it may be removed and possibly an optional replacement.
Examples:
>>> @deprecated(as_of=deprecated.ICEHOUSE)
... def a(): pass
>>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of='f()')
... def b(): pass
>>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=+1)
... def c(): pass
4. Specifying the deprecated functionality will not be removed: >>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=0) ... def d(): pass
5. Specifying a replacement, deprecated functionality will not be removed: >>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of=’f()’, remove_in=0) ... def e(): pass
Determine whether requested_version is satisfied by current_version; in other words, current_version is >= requested_version.
Parameters: |
|
---|---|
Returns: | True if compatible, False if not |
Call this function when a deprecated feature is used.
If the system is configured for fatal deprecations then the message is logged at the ‘critical’ level and DeprecatedConfig will be raised.
Otherwise, the message will be logged (once) at the ‘warn’ level.
Raises: | DeprecatedConfig if the system is configured for fatal deprecations. |
---|