Remove the offline scripts 43/64843/1
authorxudan <xudan16@huawei.com>
Fri, 9 Nov 2018 02:24:56 +0000 (21:24 -0500)
committerxudan <xudan16@huawei.com>
Fri, 9 Nov 2018 02:24:56 +0000 (21:24 -0500)
As we discussed in Dovetail weekly meeting, there is no need to maintain
all the offline scripts.

Change-Id: I360d1a211856626af91310f142c1777a77398a12
Signed-off-by: xudan <xudan16@huawei.com>
dovetail/utils/offline/config.yaml [deleted file]
dovetail/utils/offline/download.py [deleted file]
dovetail/utils/offline/load.py [deleted file]

diff --git a/dovetail/utils/offline/config.yaml b/dovetail/utils/offline/config.yaml
deleted file mode 100644 (file)
index 397a9b6..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
----
-docker_images:
-  dovetail:
-    domain: opnfv
-    tag: cvp.0.6.0
-    store_name: image_dovetail.docker
-  functest:
-    domain: opnfv
-    tag: cvp.0.5.0
-    store_name: image_functest.docker
-  yardstick:
-    domain: opnfv
-    tag: danube.3.2
-    store_name: image_yardstick.docker
-  bottlenecks:
-    domain: opnfv
-    tag: cvp.0.4.0
-    store_name: image_bottlenecks.docker
-  testapi:
-    domain: opnfv
-    tag: cvp.0.6.0
-    store_name: image_testapi.docker
-  mongo:
-    tag: 3.2.1
-    store_name: image_mongo.docker
-docker_save_path: /home/opnfv/dovetail/results/
-
-wgets:
-    sdnvpn:
-      source_url: http://artifacts.opnfv.org/sdnvpn/ubuntu-16.04-server-cloudimg-amd64-disk1.img
-      save_path: /home/opnfv/dovetail/results/
-      file_name: ubuntu-16.04-server-cloudimg-amd64-disk1.img
diff --git a/dovetail/utils/offline/download.py b/dovetail/utils/offline/download.py
deleted file mode 100755 (executable)
index b6778c9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import os
-import yaml
-
-import dovetail.utils.dovetail_utils as dt_utils
-
-
-class download(object):
-
-    def __init__(self):
-        self.curr_path = os.path.dirname(os.path.abspath(__file__))
-        with open(os.path.join(self.curr_path, 'config.yaml')) as f:
-            self.config = yaml.safe_load(f)
-
-    def main(self):
-        keys = self.config.keys()
-        if 'docker_save_path' in keys:
-            save_path = self.config['docker_save_path']
-        else:
-            save_path = self.curr_path
-        print "save files to path %s" % save_path
-        if 'docker_images' in keys:
-            for key, value in self.config['docker_images'].items():
-                if value is not None:
-                    tag = str(self.config['docker_images'][key]['tag'])
-                    if 'domain' in self.config['docker_images'][key]:
-                        domain = self.config['docker_images'][key]['domain']
-                        image_name = ''.join([domain, '/', key, ':', tag])
-                    else:
-                        image_name = ''.join([key, ':', tag])
-                    cmd = 'sudo docker pull %s' % image_name
-                    dt_utils.exec_cmd(cmd)
-                    if not os.path.exists(save_path):
-                        os.makedirs(save_path)
-                    StoreName = self.config['docker_images'][key]['store_name']
-                    image_save_path = ''.join([save_path, StoreName])
-                    cmd = 'sudo docker save -o %s %s' % \
-                        (image_save_path, image_name)
-                    dt_utils.exec_cmd(cmd)
-                    cmd = 'sudo chmod og+rw %s' % image_save_path
-                    dt_utils.exec_cmd(cmd)
-
-        if 'wgets' in keys:
-            for key, value in self.config['wgets'].items():
-                if value is not None:
-                    wget_url = self.config['wgets'][key]['source_url']
-                    wget_path = self.config['wgets'][key]['save_path']
-                    cmd = 'sudo wget -nc %s -P %s' % (wget_url, wget_path)
-                    dt_utils.exec_cmd(cmd)
-
-
-if __name__ == '__main__':
-    download = download()
-    download.main()
diff --git a/dovetail/utils/offline/load.py b/dovetail/utils/offline/load.py
deleted file mode 100755 (executable)
index e3b1fb1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import os
-import sys
-import yaml
-
-import dovetail.utils.dovetail_utils as dt_utils
-
-
-class load(object):
-    def __init__(self):
-        self.curr_path = os.path.dirname(os.path.abspath(__file__))
-        with open(os.path.join(self.curr_path, 'config.yaml')) as f:
-            self.config = yaml.safe_load(f)
-
-    def main(self):
-        keys = self.config.keys()
-        if 'docker_save_path' in keys:
-            save_path = self.config['docker_save_path']
-        else:
-            save_path = self.curr_path
-        if 'docker_images' in keys:
-            for key, value in self.config['docker_images'].items():
-                if value is not None:
-                    name = self.config['docker_images'][key]['store_name']
-                    image_save_path = os.path.join(save_path, name)
-                    if os.path.isfile(image_save_path):
-                        cmd = 'sudo docker load -i %s' % (image_save_path)
-                        dt_utils.exec_cmd(cmd)
-                    else:
-                        print "file %s not exists" % image_save_path
-        if 'wgets' in keys:
-            for key, value in self.config['wgets'].items():
-                if value is not None:
-                    try:
-                        dovetail_home = os.environ["DOVETAIL_HOME"]
-                    except KeyError:
-                        print "env variable DOVETAIL_HOME not found"
-                        sys.exit(1)
-                    name = self.config['wgets'][key]['file_name']
-                    save_path = self.config['wgets'][key]['save_path']
-                    file_path = os.path.join(save_path, name)
-                    dest_path = os.path.join(dovetail_home, 'pre_config')
-                    if not os.path.isdir(dest_path):
-                        os.mkdir(dest_path)
-                    if os.path.isfile(file_path):
-                        cmd = 'sudo cp %s %s' % (file_path, dest_path)
-                        dt_utils.exec_cmd(cmd)
-                    else:
-                        print "file %s not exists" % file_path
-
-
-if __name__ == '__main__':
-    load = load()
-    load.main()