Repository URL to install this package:
|
Version:
4.0.105 ▾
|
ó
±EYc @ s d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z e j
e Z d e
f d YZ d S( iÿÿÿÿN( t log( t _LE( t _LWt InstanceJobTrackerc B s, e Z d Z d Z d Z d Z RS( c C s t j t | _ d S( N( t collectionst defaultdictt listt jobs( t self( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/instancejobtracker.pyt __init__ s c C s | j | j j | d S( s Appends process_id of instance to cache.
This method will store the pid of a process in cache as
a key: value pair which will be used to kill the process if it
is running while deleting the instance. Instance uuid is used as
a key in the cache and pid will be the value.
:param instance: Object of instance
:param pid: Id of the process
N( R t uuidt append( R t instancet pid( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/instancejobtracker.pyt add_job" s c C si | j } | | j k rB | | j | k rB | j | j | n | j | se | j j | d n d S( sÄ Removes pid of process from cache.
This method will remove the pid of a process from the cache.
:param instance: Object of instance
:param pid: Id of the process
N( R
R t removet popt None( R R R
R
( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/instancejobtracker.pyt
remove_job/ s
"
c C s4 t | j j | j g } x| D]} y t j | t j WnR t k
r } | j t j
k r t j t
d i | d 6| d 6d | q n Xy t j | d WnK t k
rø } | j t j
k rt j t
d i | d 6d | qn$ Xt j t d i | d 6d | | j | | q% Wd S( sÕ Kills the running processes for given instance.
This method is used to kill all running processes of the instance if
it is deleted in between.
:param instance: Object of instance
sN Failed to kill process %(pid)s due to %(reason)s, while deleting the instance.R
t reasonR i s0 Unexpected error while checking process %(pid)s.sW Failed to kill a long running process %(pid)s related to the instance when deleting it.N( R R t getR
t ost killt signalt SIGKILLt OSErrort errnot ESRCHt LOGt errorR t warningR R ( R R t pids_to_removeR
t exc( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/instancejobtracker.pyt terminate_jobs? s(
( t __name__t
__module__R R R R! ( ( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/instancejobtracker.pyR s
( R R R R t oslo_logR t loggingt nova.i18nR R t getLoggerR" R t objectR ( ( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/instancejobtracker.pyt <module> s