From 4a081a7b66eac44d2e774fc8bd96d420f772e98c Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Wed, 12 Jul 2017 21:47:55 +0530 Subject: [PATCH] consumer: Implement the util methods (they raise NotImplementError now) Signed-off-by: Sayan Chowdhury --- fedimg/services/ec2/ec2imgpublisher.py | 2 +- fedimg/services/ec2/ec2imguploader.py | 2 +- fedimg/utils.py | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fedimg/services/ec2/ec2imgpublisher.py b/fedimg/services/ec2/ec2imgpublisher.py index 8f63de9..11b2a36 100644 --- a/fedimg/services/ec2/ec2imgpublisher.py +++ b/fedimg/services/ec2/ec2imgpublisher.py @@ -20,7 +20,7 @@ # from fedimg.utils import external_run_command, get_item_from_regex -from fedimg.ec2.ec2base import EC2Base +from fedimg.services.ec2.ec2base import EC2Base class EC2ImagePublisher(EC2Base): diff --git a/fedimg/services/ec2/ec2imguploader.py b/fedimg/services/ec2/ec2imguploader.py index 08fb9d0..850dfad 100644 --- a/fedimg/services/ec2/ec2imguploader.py +++ b/fedimg/services/ec2/ec2imguploader.py @@ -22,7 +22,7 @@ import re from fedimg.utils import external_run_command, get_item_from_regex -from fedimg.ec2.ec2base import EC2Base +from fedimg.services.ec2.ec2base import EC2Base class EC2ImageUploader(EC2Base): diff --git a/fedimg/utils.py b/fedimg/utils.py index dc0bbf7..ef5f5ce 100644 --- a/fedimg/utils.py +++ b/fedimg/utils.py @@ -55,7 +55,7 @@ def get_rawxz_urls(location, images): return map((lambda path: '{}/{}'.format(location, path)), rawxz_list) -def virt_types_from_url(url): +def get_virt_types_from_url(url): """ Takes a URL to a .raw.xz image file) and returns the suspected virtualization type that the image file should be registered as. """ file_name = url.split('/')[-1].lower() @@ -98,3 +98,14 @@ def safeget(dct, *keys): except KeyError: return None return dct + +def external_run_command(command): + raise NotImplementedError + + +def get_item_from_regex(regex, output): + raise NotImplementedError + + +def get_source_for_image(image_url): + raise NotImplementedError