Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr If SubscriptLoad AttributeLoad NameLoad attr Index Str body Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad While CompareNotEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Num TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Str Str SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Dict Str Str NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list decorator_list
N/A N/A 
(c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Freezer Backup modes related functions
 N/A os N/A time oslo_config cfg oslo_log log freezer.utils utils N/A CONF N/A cfg CONF N/A logging N/A N/A log getLogger __name__ N/A home N/A N/A N/A os path expanduser ~ BackupOs N/A N/A __init__ N/A N/A self client_manager container storage N/A N/A N/A 

        :param client_manager:
        :param container:
        :param storage:
        :type storage: freezer.swift.SwiftStorage
        :return:
         N/A N/A self client_manager client_manager N/A N/A self container container N/A N/A self storage storage N/A backup_nova N/A N/A self instance_id N/A N/A N/A 
        Implement nova backup
        :param instance_id: Id of the instance for backup
        :return:
         N/A instance_id instance_id N/A client_manager N/A self client_manager N/A nova N/A N/A client_manager get_nova N/A instance N/A N/A N/A nova servers get instance_id N/A glance N/A N/A client_manager get_glance N/A N/A N/A instance __dict__ N/A OS-EXT-STS:task_state N/A N/A N/A N/A time sleep 5 N/A instance N/A N/A N/A nova servers get instance N/A image_id N/A N/A N/A nova servers create_image instance N/A snapshot_of_%s instance_id N/A image N/A N/A N/A glance images get image_id N/A N/A N/A image status active N/A N/A N/A N/A time sleep 5 N/A N/A N/A image N/A N/A N/A glance images get image_id N/A N/A N/A Exception N/A e N/A N/A N/A N/A logging error e N/A stream N/A N/A client_manager download_image image N/A package N/A N/A {0}/{1} format instance_id N/A N/A N/A N/A utils DateTime now timestamp N/A N/A N/A logging info [*] Uploading image to swift N/A headers N/A x-object-meta-name x-object-meta-flavor-id N/A N/A instance _info N/A name N/A N/A N/A instance _info N/A flavor N/A id N/A N/A N/A N/A self storage add_stream stream package headers N/A N/A N/A logging info [*] Deleting temporary image N/A N/A N/A N/A glance images delete image N/A backup_cinder_by_glance N/A N/A self volume_id N/A N/A N/A 
        Implements cinder backup:
            1) Gets a stream of the image from glance
            2) Stores resulted image to the swift as multipart object

        :param volume_id: id of volume for backup
         N/A client_manager N/A self client_manager N/A cinder N/A N/A client_manager get_cinder N/A volume N/A N/A N/A cinder volumes get volume_id N/A N/A N/A logging debug Creation temporary snapshot N/A snapshot N/A N/A client_manager provide_snapshot volume N/A backup_snapshot_for_volume_%s volume_id N/A N/A N/A logging debug Creation temporary volume N/A copied_volume N/A N/A client_manager do_copy_volume snapshot N/A N/A N/A logging debug Creation temporary glance image N/A image N/A N/A client_manager make_glance_image name copied_volume N/A N/A N/A logging debug N/A N/A Download temporary glance image {0} format N/A image id N/A stream N/A N/A client_manager download_image image N/A package N/A N/A {0}/{1} format volume_id N/A N/A N/A N/A utils DateTime now timestamp N/A N/A N/A logging debug Uploading image to swift N/A headers N/A N/A N/A N/A N/A self storage add_stream stream package headers headers N/A N/A N/A logging debug Deleting temporary snapshot N/A N/A N/A client_manager clean_snapshot snapshot N/A N/A N/A logging debug Deleting temporary volume N/A N/A N/A N/A cinder volumes delete copied_volume N/A N/A N/A logging debug Deleting temporary image N/A N/A N/A N/A N/A N/A client_manager get_glance images delete N/A image id N/A backup_cinder N/A N/A self volume_id name description N/A None None N/A N/A client_manager N/A self client_manager N/A cinder N/A N/A client_manager get_cinder N/A search_opts N/A volume_id status volume_id available N/A backups N/A N/A N/A cinder backups list search_opts search_opts N/A N/A N/A len backups 0 N/A N/A incremental True N/A N/A incremental False N/A container N/A N/A {0}/{1}/{2} format N/A self container volume_id N/A N/A N/A N/A utils DateTime now timestamp N/A N/A N/A N/A cinder backups create volume_id container name description incremental incremental force True N/A N/A