Module Expr Str Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Call AttributeLoad NameLoad attr Str keyword Str keyword Str Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad keyword Str Call AttributeLoad NameLoad attr Str keyword Num keyword Str Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str Call AttributeLoad NameLoad attr Str keyword Num keyword Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad If BoolOpAnd UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr CompareIn NameLoad ListLoad Str Str body Return NameLoad orelse Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return BinOpMod AttributeLoad AttributeLoad NameLoad attr attr Dict Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMult AttributeLoad Call AttributeLoad NameLoad attr attr Num Assign NameStore BinOpMod AttributeLoad AttributeLoad NameLoad attr attr Dict Str BinOpMod Str Dict Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad Assign NameStore Dict Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore BinOpAdd NameLoad Str If BoolOpAnd CompareEq NameLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict NameLoad NameLoad orelse Assign NameStore Dict orelse Assign NameStore BinOpMod Str SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str NameLoad With Call NameLoad NameLoad Str NameStore body Return Call AttributeLoad Call AttributeLoad NameLoad attr attr decorator_list Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body If NameLoad body Return TupleLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If UnaryOpNot NameLoad body Return Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpMod Str SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Dict If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body With Call NameLoad NameLoad Str NameStore body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index BinOpMod Str NameLoad Call AttributeLoad NameLoad attr With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr With Call NameLoad NameLoad NameStore body For NameStore Call NameLoad Lambda arguments args defaults Call AttributeLoad NameLoad attr Num Str body Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return Call NameLoad NameLoad keyword Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad NameLoad keyword Str keyword Call NameLoad NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd CompareEq Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Index Num Str body If BoolOpAnd CompareGt Call NameLoad SubscriptLoad NameLoad Index Num Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpMult AttributeLoad Call AttributeLoad NameLoad attr attr Num For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareEq Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse If BoolOpAnd CompareGt Call NameLoad NameLoad BinOpAdd NameLoad Num CompareEq SubscriptLoad NameLoad Index NameLoad Str UnaryOpNot Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Continue orelse Raise Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Yield TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Yield TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Yield TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad Assign NameStore BinOpMod Str SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad NameLoad keyword NameLoad If NameLoad body If BoolOpAnd NameLoad CompareLt BinOpSub Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad If UnaryOpNot NameLoad body Expr Call NameLoad NameLoad keyword Str keyword NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad Return NameLoad orelse Return NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad If BoolOpAnd AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad Expr Call NameLoad NameLoad Return NameLoad decorator_list Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr Return Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Return TupleLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr UnaryOpNot NameLoad CompareLt NameLoad NameLoad body Return Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr If CompareLt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad orelse Expr Call NameLoad If NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If BoolOpAnd NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore UnaryOpNot NameLoad Expr Call AttributeLoad NameLoad attr Num If CompareIn NameLoad AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If BoolOpOr CompareGt NameLoad Num CompareGt NameLoad Num body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str Str NameLoad NameLoad Call AttributeLoad Str attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If BoolOpAnd CompareIn NameLoad AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Call AttributeLoad Str attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Call AttributeLoad Str attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Call AttributeLoad Str attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Return Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Return Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A N/A Image cache manager.

The cache manager implements the specification at
http://wiki.openstack.org/nova-image-cache-management.

 N/A hashlib N/A os N/A re N/A time oslo_concurrency lockutils oslo_concurrency processutils oslo_config cfg oslo_log log logging oslo_serialization jsonutils oslo_utils fileutils N/A nova.conf nova.i18n _LE nova.i18n _LI nova.i18n _LW nova utils nova.virt imagecache nova.virt.libvirt utils libvirt_utils N/A LOG N/A N/A logging getLogger __name__ N/A imagecache_opts N/A N/A N/A cfg StrOpt image_info_filename_pattern default $instances_path/$image_cache_subdirectory_name/%(image)s.info help Allows image information files to be stored in non-standard locations N/A N/A cfg BoolOpt remove_unused_kernels default True deprecated_for_removal True help DEPRECATED: Should unused kernel images be removed? This is only safe to enable if all compute nodes have been updated to support this option (running Grizzly or newer level compute). This will be the default behavior in the 13.0.0 release. N/A N/A cfg IntOpt remove_unused_resized_minimum_age_seconds default 3600 help Unused resized base images younger than this will not be removed N/A N/A cfg BoolOpt checksum_base_images default False help Write a checksum for files in _base to disk N/A N/A cfg IntOpt checksum_interval_seconds default 3600 help How frequently to checksum base images N/A CONF N/A N/A nova conf CONF N/A N/A N/A CONF register_opts imagecache_opts libvirt get_cache_fname N/A N/A images key N/A N/A N/A Return a filename based on the SHA1 hash of a given image ID.

    Image files stored in the _base directory that match this pattern
    are considered for cleanup by the image cache manager. The cache
    manager considers the file to be in use if it matches an instance's
    image_ref, kernel_id or ramdisk_id property.

    However, in grizzly-3 and before, only the image_ref property was
    considered. This means that it's unsafe to store kernel and ramdisk
    images using this pattern until we're sure that all compute nodes
    are running a cache manager newer than grizzly-3. For now, we
    require admins to confirm that by setting the remove_unused_kernels
    boolean but, at some point in the future, we'll be safely able to
    assume this.
     N/A image_id N/A str N/A images N/A key N/A N/A N/A N/A N/A CONF libvirt remove_unused_kernels N/A key N/A kernel_id ramdisk_id N/A N/A image_id N/A N/A N/A N/A N/A N/A hashlib sha1 image_id hexdigest N/A get_info_filename N/A N/A base_path N/A N/A N/A Construct a filename for storing additional information about a base
    image.

    Returns a filename.
     N/A base_file N/A N/A N/A os path basename base_path N/A N/A N/A N/A CONF libvirt image_info_filename_pattern N/A image base_file N/A is_valid_info_file N/A N/A path N/A N/A N/A Test if a given path matches the pattern for info files. N/A digest_size N/A N/A N/A N/A hashlib sha1 digestsize 2 N/A regexp N/A N/A N/A CONF libvirt image_info_filename_pattern N/A image N/A ([0-9a-f]{%(digest_size)d}|[0-9a-f]{%(digest_size)d}_sm|[0-9a-f]{%(digest_size)d}_[0-9]+) N/A digest_size digest_size N/A m N/A N/A re match regexp path N/A m N/A N/A True N/A False N/A _read_possible_json N/A N/A serialized info_file N/A N/A N/A N/A N/A d N/A N/A jsonutils loads serialized N/A N/A N/A ValueError N/A e N/A N/A N/A N/A LOG error N/A _LE Error reading image info file %(filename)s: %(error)s N/A filename error info_file e N/A d N/A N/A d N/A read_stored_info N/A N/A target field timestamped N/A None False N/A N/A Read information about an image.

    Returns an empty dictionary if there is no info, just the field value if
    a field is requested, or the entire dictionary otherwise.
     N/A info_file N/A get_info_filename target N/A N/A N/A N/A N/A os path exists info_file N/A N/A old_filename N/A target .sha1 N/A N/A N/A field sha1 N/A N/A N/A os path exists old_filename N/A N/A N/A open old_filename hash_file N/A N/A hash_value N/A N/A hash_file read N/A N/A write_stored_info target field field value hash_value N/A N/A N/A os remove old_filename N/A d N/A field hash_value N/A N/A d N/A N/A N/A lock_name N/A info-%s N/A N/A N/A N/A os path split target N/A -1 N/A lock_path N/A N/A N/A os path join N/A CONF instances_path locks read_file N/A N/A info_file N/A N/A N/A N/A N/A LOG debug Reading image info file: %s info_file N/A N/A open info_file r f N/A N/A N/A N/A N/A N/A f read rstrip N/A N/A N/A utils synchronized lock_name external True lock_path lock_path N/A serialized N/A read_file info_file N/A d N/A _read_possible_json serialized info_file N/A field N/A N/A timestamped N/A N/A N/A N/A N/A d get field None N/A N/A d get N/A %s-timestamp field None N/A N/A N/A N/A d get field None N/A d N/A write_stored_info N/A N/A target field value N/A None None N/A N/A Write information about an image. N/A N/A field N/A N/A N/A info_file N/A get_info_filename target N/A N/A N/A LOG info N/A _LI Writing stored info to %s info_file N/A N/A N/A fileutils ensure_tree N/A N/A N/A os path dirname info_file N/A lock_name N/A info-%s N/A N/A N/A N/A os path split target N/A -1 N/A lock_path N/A N/A N/A os path join N/A CONF instances_path locks write_file N/A N/A info_file field value N/A N/A N/A d N/A N/A N/A N/A N/A os path exists info_file N/A N/A N/A open info_file r f N/A N/A d N/A _read_possible_json N/A N/A f read info_file N/A N/A d N/A field value N/A N/A d N/A N/A %s-timestamp field N/A N/A time time N/A N/A open info_file w f N/A N/A N/A N/A f write N/A N/A jsonutils dumps d N/A N/A N/A utils synchronized lock_name external True lock_path lock_path N/A N/A write_file info_file field value N/A _hash_file N/A N/A filename N/A N/A N/A Generate a hash for the contents of a file. N/A checksum N/A N/A hashlib sha1 N/A N/A open filename f N/A N/A chunk N/A iter N/A N/A N/A N/A N/A N/A f read 32768 N/A N/A N/A N/A checksum update chunk N/A N/A N/A checksum hexdigest N/A read_stored_checksum N/A N/A target timestamped N/A True N/A N/A Read the checksum.

    Returns the checksum (as hex) or None.
     N/A N/A read_stored_info target field sha1 timestamped timestamped N/A write_stored_checksum N/A N/A target N/A N/A N/A Write a checksum to disk for a file in _base. N/A N/A write_stored_info target field sha1 value N/A _hash_file target N/A ImageCacheManager N/A N/A imagecache ImageCacheManager N/A __init__ N/A N/A self N/A N/A N/A N/A N/A N/A super ImageCacheManager self __init__ N/A N/A self lock_path N/A N/A N/A os path join N/A CONF instances_path locks N/A N/A N/A self _reset_state N/A _reset_state N/A N/A self N/A N/A N/A Reset state variables used for each pass. N/A N/A self used_images N/A N/A N/A self image_popularity N/A N/A N/A self instance_names N/A set N/A N/A self back_swap_images N/A set N/A N/A self used_swap_images N/A set N/A N/A self active_base_files N/A N/A N/A self corrupt_base_files N/A N/A N/A self originals N/A N/A N/A self removable_base_files N/A N/A N/A self unexplained_images N/A N/A _store_image N/A N/A self base_dir ent original N/A False N/A N/A Store a base image for later examination. N/A entpath N/A N/A N/A os path join base_dir ent N/A N/A N/A N/A os path isfile entpath N/A N/A N/A N/A N/A self unexplained_images append entpath N/A original N/A N/A N/A N/A N/A self originals append entpath N/A _store_swap_image N/A N/A self ent N/A N/A N/A Store base swap images for later examination. N/A names N/A N/A ent split _ N/A N/A N/A N/A len names 2 N/A N/A names N/A 0 swap N/A N/A N/A N/A N/A len N/A names N/A 1 0 N/A N/A N/A names N/A 1 isdigit N/A N/A N/A N/A LOG debug Adding %s into backend swap images ent N/A N/A N/A N/A self back_swap_images add ent N/A _list_base_images N/A N/A self base_dir N/A N/A N/A Return a list of the images present in _base.

        Determine what images we have on disk. There will be other files in
        this directory so we only grab the ones which are the right length
        to be disk images.
         N/A digest_size N/A N/A N/A N/A hashlib sha1 digestsize 2 N/A ent N/A N/A os listdir base_dir N/A N/A N/A N/A len ent digest_size N/A N/A N/A N/A self _store_image base_dir ent original True N/A N/A N/A N/A N/A len ent N/A digest_size 2 N/A N/A ent N/A digest_size _ N/A N/A is_valid_info_file N/A N/A N/A os path join base_dir ent N/A N/A N/A N/A self _store_image base_dir ent original False N/A N/A N/A N/A self _store_swap_image ent N/A N/A unexplained_images originals N/A self unexplained_images N/A self originals N/A _list_backing_images N/A N/A self N/A N/A N/A List the backing images currently in use. N/A inuse_images N/A N/A ent N/A N/A os listdir N/A CONF instances_path N/A N/A N/A ent N/A self instance_names N/A N/A N/A N/A LOG debug %s is a valid instance name ent N/A disk_path N/A N/A N/A os path join N/A CONF instances_path ent disk N/A N/A N/A N/A os path exists disk_path N/A N/A N/A N/A LOG debug %s has a disk file ent N/A N/A N/A backing_file N/A N/A libvirt_utils get_disk_backing_file disk_path N/A N/A N/A N/A processutils ProcessExecutionError N/A N/A N/A N/A N/A N/A os path exists disk_path N/A N/A N/A N/A LOG debug Failed to get disk backing file: %s disk_path N/A N/A N/A N/A N/A N/A LOG debug Instance %(instance)s is backed by %(backing)s N/A instance backing ent backing_file N/A backing_file N/A N/A backing_path N/A N/A N/A os path join N/A CONF instances_path N/A CONF image_cache_subdirectory_name backing_file N/A N/A backing_path inuse_images N/A N/A N/A N/A inuse_images append backing_path N/A N/A backing_path N/A self unexplained_images N/A N/A N/A N/A LOG warning N/A _LW Instance %(instance)s is using a backing file %(backing)s which does not appear in the image service N/A instance backing ent backing_file N/A N/A N/A N/A self unexplained_images remove backing_path N/A inuse_images N/A _find_base_file N/A N/A self base_dir fingerprint N/A N/A N/A Find the base file matching this fingerprint.

        Yields the name of the base file, a boolean which is True if the image
        is "small", and a boolean which indicates if this is a resized image.
        Note that it is possible for more than one yield to result from this
        check.

        If no base file is found, then nothing is yielded.
         N/A base_file N/A N/A N/A os path join base_dir fingerprint N/A N/A N/A N/A os path exists base_file N/A N/A N/A N/A base_file False False N/A base_file N/A N/A N/A os path join base_dir N/A fingerprint _sm N/A N/A N/A N/A os path exists base_file N/A N/A N/A N/A base_file True False N/A resize_re N/A N/A re compile N/A .*/%s_[0-9]+$ fingerprint N/A img N/A self unexplained_images N/A N/A m N/A N/A resize_re match img N/A m N/A N/A N/A N/A img False True N/A _verify_checksum N/A N/A self img_id base_file create_if_missing N/A True N/A N/A Compare the checksum stored on disk with the current file.

        Note that if the checksum fails to verify this is logged, but no actual
        action occurs. This is something sysadmins should monitor for and
        handle manually when it occurs.
         N/A N/A N/A N/A CONF libvirt checksum_base_images N/A N/A None N/A lock_name N/A hash-%s N/A N/A N/A N/A os path split base_file N/A -1 inner_verify_checksum N/A N/A N/A N/A N/A N/A stored_checksum stored_timestamp N/A read_stored_checksum base_file timestamped True N/A stored_checksum N/A N/A N/A stored_timestamp N/A N/A N/A N/A time time stored_timestamp N/A N/A CONF libvirt checksum_interval_seconds N/A N/A True N/A N/A stored_timestamp N/A N/A N/A write_stored_info base_file field sha1 value stored_checksum N/A current_checksum N/A _hash_file base_file N/A N/A current_checksum stored_checksum N/A N/A N/A N/A LOG error N/A _LE image %(id)s at (%(base_file)s): image verification failed N/A id base_file img_id base_file N/A False N/A N/A True N/A N/A N/A N/A LOG info N/A _LI image %(id)s at (%(base_file)s): image verification skipped, no hash stored N/A id base_file img_id base_file N/A N/A N/A N/A CONF libvirt checksum_base_images create_if_missing N/A N/A N/A N/A LOG info N/A _LI %(id)s (%(base_file)s): generating checksum N/A id base_file img_id base_file N/A N/A write_stored_checksum base_file N/A None N/A N/A N/A utils synchronized lock_name external True lock_path N/A self lock_path N/A N/A inner_verify_checksum N/A _get_age_of_file N/A N/A base_file N/A N/A N/A N/A N/A N/A N/A os path exists base_file N/A N/A N/A N/A LOG debug Cannot remove %s, it does not exist base_file N/A N/A False 0 N/A mtime N/A N/A N/A os path getmtime base_file N/A age N/A N/A N/A time time mtime N/A N/A True age N/A staticmethod _remove_old_enough_file N/A N/A self base_file maxage remove_sig remove_lock N/A True True N/A N/A Remove a single swap or base file if it is old enough. N/A N/A exists age N/A N/A self _get_age_of_file base_file N/A N/A exists N/A N/A N/A lock_file N/A N/A N/A N/A os path split base_file N/A -1 _inner_remove_old_enough_file N/A N/A N/A N/A N/A N/A exists age N/A N/A self _get_age_of_file base_file N/A N/A N/A exists N/A age maxage N/A N/A N/A N/A N/A LOG info N/A _LI Removing base or swap file: %s base_file N/A N/A N/A N/A N/A os remove base_file N/A remove_sig N/A N/A signature N/A get_info_filename base_file N/A N/A N/A N/A os path exists signature N/A N/A N/A N/A os remove signature N/A N/A N/A OSError N/A e N/A N/A N/A N/A LOG error N/A _LE Failed to remove %(base_file)s, error was %(error)s N/A base_file error base_file e N/A N/A N/A utils synchronized lock_file external True lock_path N/A self lock_path N/A N/A age maxage N/A N/A N/A N/A LOG info N/A _LI Base or swap file too young to remove: %s base_file N/A N/A N/A _inner_remove_old_enough_file N/A remove_lock N/A N/A N/A N/A N/A N/A lockutils remove_external_lock_file lock_file lock_file_prefix nova- lock_path N/A self lock_path N/A N/A N/A OSError N/A e N/A N/A N/A N/A LOG debug Failed to remove %(lock_file)s, error was %(error)s N/A lock_file error lock_file e N/A _remove_swap_file N/A N/A self base_file N/A N/A N/A Remove a single swap base file if it is old enough. N/A maxage N/A CONF remove_unused_original_minimum_age_seconds N/A N/A N/A self _remove_old_enough_file base_file maxage remove_sig False remove_lock False N/A _remove_base_file N/A N/A self base_file N/A N/A N/A Remove a single base file if it is old enough. N/A maxage N/A N/A CONF libvirt remove_unused_resized_minimum_age_seconds N/A N/A base_file N/A self originals N/A N/A maxage N/A CONF remove_unused_original_minimum_age_seconds N/A N/A N/A self _remove_old_enough_file base_file maxage N/A _handle_base_image N/A N/A self img_id base_file N/A N/A N/A Handle the checks for a single base image. N/A image_bad False N/A image_in_use False N/A N/A N/A LOG info N/A _LI image %(id)s at (%(base_file)s): checking N/A id base_file img_id base_file N/A N/A base_file N/A self unexplained_images N/A N/A N/A N/A N/A self unexplained_images remove base_file N/A N/A base_file N/A N/A N/A os path exists base_file N/A N/A N/A os path isfile base_file N/A N/A checksum_result N/A N/A self _verify_checksum img_id base_file N/A N/A checksum_result None N/A N/A image_bad N/A checksum_result N/A N/A N/A time sleep 0 N/A N/A img_id N/A self used_images N/A N/A N/A local remote instances N/A N/A self used_images N/A img_id N/A N/A N/A local 0 N/A remote 0 N/A N/A image_in_use True N/A N/A N/A LOG info N/A _LI image %(id)s at (%(base_file)s): in use: on this node %(local)d local, %(remote)d on other nodes sharing this instance storage N/A id base_file local remote img_id base_file local remote N/A N/A N/A N/A self active_base_files append base_file N/A N/A base_file N/A N/A N/A N/A LOG warning N/A _LW image %(id)s at (%(base_file)s): warning -- an absent base file is in use! instances: %(instance_list)s N/A id base_file instance_list img_id base_file N/A N/A join instances N/A image_bad N/A N/A N/A N/A N/A self corrupt_base_files append base_file N/A base_file N/A N/A N/A image_in_use N/A N/A N/A N/A LOG debug image %(id)s at (%(base_file)s): image is not in use N/A id base_file img_id base_file N/A N/A N/A N/A self removable_base_files append base_file N/A N/A N/A N/A LOG debug image %(id)s at (%(base_file)s): image is in use N/A id base_file img_id base_file N/A N/A N/A N/A os path exists base_file N/A N/A N/A N/A libvirt_utils update_mtime base_file N/A _age_and_verify_swap_images N/A N/A self context base_dir N/A N/A N/A N/A N/A LOG debug Verify swap images N/A ent N/A self back_swap_images N/A N/A base_file N/A N/A N/A os path join base_dir ent N/A N/A N/A ent N/A self used_swap_images N/A N/A N/A os path exists base_file N/A N/A N/A N/A libvirt_utils update_mtime base_file N/A N/A N/A self remove_unused_base_images N/A N/A N/A N/A self _remove_swap_file base_file N/A error_images N/A N/A self used_swap_images N/A self back_swap_images N/A error_image error_images N/A N/A N/A N/A LOG warning N/A _LW %s swap image was used by instance but no back files existing! error_image N/A _age_and_verify_cached_images N/A N/A self context all_instances base_dir N/A N/A N/A N/A N/A LOG debug Verify base images N/A img N/A self used_images N/A N/A fingerprint N/A N/A N/A N/A hashlib sha1 img hexdigest N/A N/A N/A LOG debug Image id %(id)s yields fingerprint %(fingerprint)s N/A id fingerprint img fingerprint N/A result N/A N/A self _find_base_file base_dir fingerprint N/A N/A N/A base_file image_small image_resized result N/A N/A N/A self _handle_base_image img base_file N/A N/A N/A image_small N/A image_resized N/A N/A N/A N/A N/A self originals append base_file N/A inuse_backing_images N/A N/A self _list_backing_images N/A backing_path inuse_backing_images N/A N/A N/A backing_path N/A self active_base_files N/A N/A N/A N/A N/A self active_base_files append backing_path N/A img N/A self unexplained_images N/A N/A N/A N/A LOG warning N/A _LW Unknown base file: %s img N/A N/A N/A N/A self removable_base_files append img N/A N/A self active_base_files N/A N/A N/A N/A LOG info N/A _LI Active base files: %s N/A N/A join N/A self active_base_files N/A N/A self corrupt_base_files N/A N/A N/A N/A LOG info N/A _LI Corrupt base files: %s N/A N/A join N/A self corrupt_base_files N/A N/A self removable_base_files N/A N/A N/A N/A LOG info N/A _LI Removable base files: %s N/A N/A join N/A self removable_base_files N/A N/A self remove_unused_base_images N/A N/A base_file N/A self removable_base_files N/A N/A N/A N/A self _remove_base_file base_file N/A N/A N/A LOG debug Verification complete N/A _get_base N/A N/A self N/A N/A N/A base_dir N/A N/A N/A os path join N/A CONF instances_path N/A CONF image_cache_subdirectory_name N/A N/A N/A N/A N/A os path exists base_dir N/A N/A N/A N/A LOG debug Skipping verification, no base directory at %s base_dir N/A N/A base_dir N/A update N/A N/A self context all_instances N/A N/A N/A base_dir N/A N/A self _get_base N/A N/A base_dir N/A N/A N/A N/A N/A self _reset_state N/A N/A N/A self _list_base_images base_dir N/A running N/A N/A self _list_running_instances context all_instances N/A N/A self used_images N/A running N/A used_images N/A N/A self image_popularity N/A running N/A image_popularity N/A N/A self instance_names N/A running N/A instance_names N/A N/A self used_swap_images N/A running N/A used_swap_images N/A N/A N/A self _age_and_verify_cached_images context all_instances base_dir N/A N/A N/A self _age_and_verify_swap_images context base_dir N/A N/A