Module Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias ImportFrom alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore BinOpMult Num Num Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Str Assign NameStore ListLoad Call AttributeLoad NameLoad attr Str keyword Str keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Num keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Str keyword ListLoad Str Str keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Num keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Str keyword ListLoad Str Str keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore BinOpMod Str NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr TupleLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num NameLoad body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad Str If BoolOpAnd CompareIsNot NameLoad NameLoad CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return Call NameLoad NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str decorator_list AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword BinOpMod Call NameLoad Str AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword BinOpMod Call NameLoad Str AttributeLoad NameLoad attr With AttributeLoad NameLoad attr NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr NameLoad name NameStore body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword Call NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore NameLoad If NameLoad body Assign NameStore ListLoad Str Str Str For NameStore NameLoad body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Break handlers ExceptHandler type NameLoad body Continue Return Dict Str Str Str Call NameLoad NameLoad NameLoad Dict decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword Call NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr TryExcept body If BoolOpAnd CompareEq NameLoad AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Dict Str Str Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr NameLoad Dict decorator_list decorator_list Assign NameStore Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr attr TryExcept body Assign NameStore SubscriptLoad NameLoad Index BoolOpOr NameLoad Str handlers ExceptHandler type NameLoad body Raise Call AttributeLoad NameLoad attr keyword NameLoad keyword BinOpMod Call NameLoad Str NameLoad If CompareEq NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad Return Call NameLoad decorator_list
N/A N/A abc N/A datetime N/A os N/A shutil oslo_config cfg oslo_utils importutils N/A requests N/A sendfile N/A six six.moves http_client N/A six.moves.urllib.parse urlparse ironic.common exception ironic.common.i18n _ ironic.common keystone ironic.common utils N/A IMAGE_CHUNK_SIZE N/A 1024 1024 N/A CONF N/A cfg CONF N/A N/A N/A CONF import_opt my_ip ironic.netconf N/A glance_opts N/A N/A N/A cfg StrOpt glance_host default $my_ip help N/A _ Default glance hostname or IP address. N/A N/A cfg PortOpt glance_port default 9292 help N/A _ Default glance port. N/A N/A cfg StrOpt glance_protocol default http choices N/A http https help N/A _ Default protocol to use when connecting to glance. Set to https for SSL. N/A N/A cfg ListOpt glance_api_servers help N/A _ A list of the glance api servers available to ironic. Prefix with https:// for SSL-based glance API servers. Format is [hostname|IP]:port. N/A N/A cfg BoolOpt glance_api_insecure default False help N/A _ Allow to perform insecure SSL (https) requests to glance. N/A N/A cfg IntOpt glance_num_retries default 0 help N/A _ Number of retries when downloading an image from glance. N/A N/A cfg StrOpt auth_strategy default keystone choices N/A keystone noauth help N/A _ Authentication strategy to use when connecting to glance. N/A N/A cfg StrOpt glance_cafile help N/A _ Optional path to a CA certificate bundle to be used to validate the SSL certificate served by glance. It is used when glance_api_insecure is set to False. N/A N/A N/A CONF register_opts glance_opts group glance import_versioned_module N/A N/A version submodule N/A None N/A N/A module N/A ironic.common.glance_service.v%s version N/A submodule N/A N/A module N/A N/A . join N/A module submodule N/A N/A N/A importutils try_import module N/A GlanceImageService N/A N/A client version context N/A None 1 None N/A N/A module N/A import_versioned_module version image_service N/A service_class N/A getattr module GlanceImageService N/A N/A N/A context None N/A N/A N/A CONF glance auth_strategy keystone N/A N/A context auth_token N/A N/A N/A context auth_token N/A N/A keystone get_admin_auth_token N/A N/A service_class client version context N/A BaseImageService N/A object N/A N/A Provides retrieval of disk images. validate_href N/A N/A self image_href N/A N/A N/A Validate image reference.

        :param image_href: Image reference.
        :raises: exception.ImageRefValidationFailed.
        :returns: Information needed to further operate with an image.
         N/A N/A abc abstractmethod download N/A N/A self image_href image_file N/A N/A N/A Downloads image to specified location.

        :param image_href: Image reference.
        :param image_file: File object to write data to.
        :raises: exception.ImageRefValidationFailed.
        :raises: exception.ImageDownloadFailed.
         N/A N/A abc abstractmethod show N/A N/A self image_href N/A N/A N/A Get dictionary of image properties.

        :param image_href: Image reference.
        :raises: exception.ImageRefValidationFailed.
        :returns: dictionary of image properties. It has three of them: 'size',
            'updated_at' and 'properties'. 'updated_at' attribute is a naive
            UTC datetime object.
         N/A N/A abc abstractmethod N/A N/A N/A six add_metaclass N/A abc ABCMeta HttpImageService N/A BaseImageService N/A N/A Provides retrieval of disk images using HTTP. validate_href N/A N/A self image_href N/A N/A N/A Validate HTTP image reference.

        :param image_href: Image reference.
        :raises: exception.ImageRefValidationFailed if HEAD request failed or
            returned response code not equal to 200.
        :returns: Response to HEAD request.
         N/A N/A N/A response N/A N/A requests head image_href N/A N/A N/A response status_code N/A http_client OK N/A N/A N/A N/A exception ImageRefValidationFailed image_href image_href reason N/A N/A _ Got HTTP code %s instead of 200 in response to HEAD request. N/A response status_code N/A N/A N/A N/A requests RequestException N/A e N/A N/A N/A N/A exception ImageRefValidationFailed image_href image_href reason e N/A response N/A download N/A N/A self image_href image_file N/A N/A N/A Downloads image to specified location.

        :param image_href: Image reference.
        :param image_file: File object to write data to.
        :raises: exception.ImageRefValidationFailed if GET request returned
            response code not equal to 200.
        :raises: exception.ImageDownloadFailed if:
            * IOError happened during file write;
            * GET request failed.
         N/A N/A N/A response N/A N/A requests get image_href stream True N/A N/A N/A response status_code N/A http_client OK N/A N/A N/A N/A exception ImageRefValidationFailed image_href image_href reason N/A N/A _ Got HTTP code %s instead of 200 in response to GET request. N/A response status_code N/A N/A response raw input_img N/A N/A N/A N/A shutil copyfileobj input_img image_file IMAGE_CHUNK_SIZE N/A N/A N/A N/A N/A requests RequestException IOError N/A e N/A N/A N/A N/A exception ImageDownloadFailed image_href image_href reason e N/A show N/A N/A self image_href N/A N/A N/A Get dictionary of image properties.

        :param image_href: Image reference.
        :raises: exception.ImageRefValidationFailed if:
            * HEAD request failed;
            * HEAD request returned response code not equal to 200;
            * Content-Length header not found in response to HEAD request.
        :returns: dictionary of image properties. It has three of them: 'size',
            'updated_at' and 'properties'. 'updated_at' attribute is a naive
            UTC datetime object.
         N/A response N/A N/A self validate_href image_href N/A image_size N/A N/A N/A response headers get Content-Length N/A N/A image_size None N/A N/A N/A N/A exception ImageRefValidationFailed image_href image_href reason N/A _ Cannot determine image size as there is no Content-Length header specified in response to HEAD request. N/A str_date N/A N/A N/A response headers get Last-Modified N/A date None N/A str_date N/A N/A http_date_format_strings N/A %a, %d %b %Y %H:%M:%S GMT %A, %d-%b-%y %H:%M:%S GMT %a %b %d %H:%M:%S %Y N/A fmt http_date_format_strings N/A N/A N/A N/A date N/A N/A N/A datetime datetime strptime str_date fmt N/A N/A N/A N/A ValueError N/A N/A N/A N/A size updated_at properties N/A int image_size date N/A N/A N/A FileImageService N/A BaseImageService N/A N/A Provides retrieval of disk images available locally on the conductor. validate_href N/A N/A self image_href N/A N/A N/A Validate local image reference.

        :param image_href: Image reference.
        :raises: exception.ImageRefValidationFailed if source image file
            doesn't exist.
        :returns: Path to image file if it exists.
         N/A image_path N/A N/A N/A urlparse urlparse image_href path N/A N/A N/A N/A N/A os path isfile image_path N/A N/A N/A N/A exception ImageRefValidationFailed image_href image_href reason N/A _ Specified image file not found. N/A image_path N/A download N/A N/A self image_href image_file N/A N/A N/A Downloads image to specified location.

        :param image_href: Image reference.
        :param image_file: File object to write data to.
        :raises: exception.ImageRefValidationFailed if source image file
            doesn't exist.
        :raises: exception.ImageDownloadFailed if exceptions were raised while
            writing to file or creating hard link.
         N/A source_image_path N/A N/A self validate_href image_href N/A dest_image_path N/A image_file name N/A local_device N/A N/A N/A os stat dest_image_path st_dev N/A N/A N/A N/A N/A local_device N/A N/A N/A os stat source_image_path st_dev N/A N/A os access source_image_path N/A N/A os R_OK N/A os W_OK N/A N/A N/A N/A image_file close N/A N/A N/A os remove dest_image_path N/A N/A N/A os link source_image_path dest_image_path N/A N/A filesize N/A N/A N/A os path getsize source_image_path N/A N/A open source_image_path rb input_img N/A N/A N/A N/A sendfile sendfile N/A N/A image_file fileno N/A N/A input_img fileno 0 filesize N/A N/A N/A Exception N/A e N/A N/A N/A N/A exception ImageDownloadFailed image_href image_href reason e N/A show N/A N/A self image_href N/A N/A N/A Get dictionary of image properties.

        :param image_href: Image reference.
        :raises: exception.ImageRefValidationFailed if image file specified
            doesn't exist.
        :returns: dictionary of image properties. It has three of them: 'size',
            'updated_at' and 'properties'. 'updated_at' attribute is a naive
            UTC datetime object.
         N/A source_image_path N/A N/A self validate_href image_href N/A N/A size updated_at properties N/A N/A N/A os path getsize source_image_path N/A N/A utils unix_file_modification_datetime source_image_path N/A N/A N/A N/A protocol_mapping N/A http https file glance HttpImageService HttpImageService FileImageService GlanceImageService get_image_service N/A N/A image_href client version context N/A None 1 None N/A N/A Get image service instance to download the image.

    :param image_href: String containing href to get image service for.
    :param client: Glance client to be used for download, used only if
        image_href is Glance href.
    :param version: Version of Glance API to use, used only if image_href is
        Glance href.
    :param context: request context, used only if image_href is Glance href.
    :raises: exception.ImageRefValidationFailed if no image service can
        handle specified href.
    :returns: Instance of an image service class that is able to download
        specified image.
     N/A scheme N/A N/A N/A N/A N/A urlparse urlparse image_href scheme lower N/A N/A N/A cls N/A protocol_mapping N/A N/A scheme glance N/A N/A N/A KeyError N/A N/A N/A N/A exception ImageRefValidationFailed image_href image_href reason N/A N/A _ Image download protocol %s is not supported. scheme N/A N/A cls GlanceImageService N/A N/A N/A cls client version context N/A N/A cls N/A