]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/calamari_setup: build ice-tools virtualenv if building iceball
authorDan Mick <dan.mick@redhat.com>
Tue, 13 Jan 2015 03:42:19 +0000 (19:42 -0800)
committerDan Mick <dan.mick@redhat.com>
Tue, 13 Jan 2015 03:56:58 +0000 (19:56 -0800)
ice-tools needs a virtualenv populated to properly run to build
an iceball; add the commands to do that.  Also remove the built
iceball when the task exits.

Fixes: #10523
Signed-off-by: Dan Mick <dan.mick@redhat.com>
tasks/calamari_setup.py

index 75e791d0fdcbec8805b31f9e955f63524222d54e..b69c5999738bc90095c7b6990c8cea40b6ae9a63 100644 (file)
@@ -215,16 +215,33 @@ def calamari_install(config, cal_svr):
         if not os.path.isdir(ice_tool_loc):
             try:
                 subprocess.check_call(['git', 'clone',
-                                       git_icetool_loc + os.sep + 
+                                       git_icetool_loc + os.sep +
                                        'ice-tools.git',
                                        ice_tool_loc])
             except subprocess.CalledProcessError:
-                raise RuntimeError('client.0 not found in roles')
-        exec_ice = os.path.join(ice_tool_loc, 'iceball', 'ice_repo_tgz.py')
+                raise RuntimeError('git clone of ice-tools failed')
+        exec_ice = os.path.join(ice_tool_loc,
+                                'teuth-virtenv/bin/make_iceball')
         try:
-            subprocess.check_call([exec_ice, '-b', version, '-o', ice_distro])
+            subprocess.check_call('virtualenv teuth-virtenv'.split(),
+                                  cwd=ice_tool_loc)
+            subprocess.check_call(
+                'teuth-virtenv/bin/python setup.py develop'.split(),
+                cwd=ice_tool_loc
+            )
+            subprocess.check_call(
+                'teuth-virtenv/bin/pip install -r requirements.txt'.split(),
+                cwd=ice_tool_loc
+            )
+            subprocess.check_call([exec_ice, '-I', ice_version,
+                                   '-b', version, '-o', ice_distro])
+            delete_iceball = True
         except subprocess.CalledProcessError:
-            raise RuntimeError('Unable to create %s distro' % ice_distro)
+            raise RuntimeError('%s failed for %s distro' %
+                               (exec_ice, ice_distro))
+        subprocess.check_call('rm -rf teuth-virtenv'.split(),
+                              cwd=ice_tool_loc)
+
     gz_file = 'ICE-{0}-{1}.tar.gz'.format(ice_version, ice_distro)
     lgz_file = os.path.join(iceball_loc, gz_file)
     cal_svr.put_file(lgz_file, os.path.join('/tmp/', gz_file))