Browse Source

HPCC-22399 Update install scripts for python >= 3.4

Signed-off-by: Mark Kelly <mark.kelly@lexisnexisrisk.com>
Mark Kelly 4 years ago
parent
commit
ecb61696c2

+ 1 - 1
initfiles/componentfiles/configschema/xsd/envsettings.xsd

@@ -20,7 +20,7 @@
         xmlns:hpcc="someuri">
     <xs:include schemaLocation="types.xsd"/>
     <hpcc:insert hpcc:schemaPath="/Environment/EnvSettings">
-        <xs:element name="additionalPlugins" hpcc:displayName="Additional Plugins" type="xs:string" hpcc:forcedConfigValue="python2" hpcc:class="setting"/>
+        <xs:element name="additionalPlugins" hpcc:displayName="Additional Plugins" type="xs:string" hpcc:forcedConfigValue="python3" hpcc:class="setting"/>
         <xs:element name="allow_pgcache_flush" hpcc:displayName="Allow PG Cache Flush" type="xs:boolean" hpcc:forcedConfigValue="true" hpcc:class="setting"/>
         <xs:element name="blockname" hpcc:displayName="HPCC" type="xs:boolean" hpcc:forcedConfigValue="HPCCSystems" hpcc:class="setting"/>
         <xs:element name="classpath" hpcc:displayName="Class Path" type="absolutePath" hpcc:forcedConfigValue="${INSTALL_DIR}/classes" hpcc:class="setting"/>

+ 4 - 4
initfiles/sbin/cluster_script.py

@@ -22,11 +22,11 @@ import sys
 import os
 import os.path
 import getopt
-import Queue
+import queue
 import time
 import datetime
 import logging
-import ConfigParser
+import configparser
 import signal
 
 def signal_handler(signal, frame):
@@ -73,7 +73,7 @@ class ScriptExecution(object):
 
     def get_config(self, key):
         if not self.hpcc_config:
-            self.hpcc_config = ConfigParser.ConfigParser()
+            self.hpcc_config = configparser.ConfigParser()
             self.hpcc_config.read(self.env_conf)
 
         return self.hpcc_config.get(self.section, key)
@@ -98,7 +98,7 @@ class ScriptExecution(object):
     def setup(self):
 
 
-        self.queue = Queue.Queue()
+        self.queue = queue.Queue()
 
         # Get hosts information
         if self.host_list_file:

+ 1 - 1
initfiles/sbin/deploy-java-files.sh.in

@@ -479,7 +479,7 @@ EXPECT_SCRIPT_FILE=
 
 createScriptFileFoot
 
-expected_python_version=2.6
+expected_python_version=3.4
 is_python_installed ${expected_python_version}
 if [ $? -eq 0 ]
 then

+ 1 - 1
initfiles/sbin/hpcc-run.sh.in

@@ -348,7 +348,7 @@ configfile=${CONFIG_DIR}/${ENV_CONF_FILE}
 
 hasPython=0
 save=0
-expected_python_version=2.6
+expected_python_version=3.4
 is_python_installed $expected_python_version
 [[ $? -eq 0 ]] && hasPython=1
 concurrent=0

+ 1 - 1
initfiles/sbin/hpcc/cluster/task.py

@@ -129,7 +129,7 @@ class ScriptTask(Task):
         option. Also user should ensure the script permission to
         protect the script from malicious modification.
         '''
-        cmd = self.script_file + " " + host.ip
+        cmd = self.script_file + " " + host.ip.decode('utf-8')
         self.logger.info(cmd)
         if not self.validateScriptFile():
             self.logger.error("Script file check sum does not match")

+ 3 - 3
initfiles/sbin/hpcc/cluster/thread.py

@@ -18,7 +18,7 @@
 '''
 
 import threading
-import Queue
+import queue
 
 class ThreadWithQueue(threading.Thread):
     '''
@@ -41,7 +41,7 @@ class ThreadWithQueue(threading.Thread):
     def run(self):
         while self.keepAlive:
             try:
-                # block is false, timeout is 1 second. Ignore Queue.Empty exception
+                # block is false, timeout is 1 second. Ignore queue.Empty exception
                 # thread is controlled by keepAlive
                 items = self.queue.get(False, 1)
                 func = items[0]
@@ -49,4 +49,4 @@ class ThreadWithQueue(threading.Thread):
                 func(*args)
 
                 self.queue.task_done()
-            except Queue.Empty: pass
+            except queue.Empty: pass

+ 1 - 1
initfiles/sbin/install-cluster.sh.in

@@ -205,7 +205,7 @@ export KEY_DIR
 
 createPayload;
 
-expected_python_version=2.6
+expected_python_version=3.4
 is_python_installed ${expected_python_version}
 
 if [ $? -eq 0 ]