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">
         xmlns:hpcc="someuri">
     <xs:include schemaLocation="types.xsd"/>
     <xs:include schemaLocation="types.xsd"/>
     <hpcc:insert hpcc:schemaPath="/Environment/EnvSettings">
     <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="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="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"/>
         <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
 import os.path
 import os.path
 import getopt
 import getopt
-import Queue
+import queue
 import time
 import time
 import datetime
 import datetime
 import logging
 import logging
-import ConfigParser
+import configparser
 import signal
 import signal
 
 
 def signal_handler(signal, frame):
 def signal_handler(signal, frame):
@@ -73,7 +73,7 @@ class ScriptExecution(object):
 
 
     def get_config(self, key):
     def get_config(self, key):
         if not self.hpcc_config:
         if not self.hpcc_config:
-            self.hpcc_config = ConfigParser.ConfigParser()
+            self.hpcc_config = configparser.ConfigParser()
             self.hpcc_config.read(self.env_conf)
             self.hpcc_config.read(self.env_conf)
 
 
         return self.hpcc_config.get(self.section, key)
         return self.hpcc_config.get(self.section, key)
@@ -98,7 +98,7 @@ class ScriptExecution(object):
     def setup(self):
     def setup(self):
 
 
 
 
-        self.queue = Queue.Queue()
+        self.queue = queue.Queue()
 
 
         # Get hosts information
         # Get hosts information
         if self.host_list_file:
         if self.host_list_file:

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

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

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

@@ -348,7 +348,7 @@ configfile=${CONFIG_DIR}/${ENV_CONF_FILE}
 
 
 hasPython=0
 hasPython=0
 save=0
 save=0
-expected_python_version=2.6
+expected_python_version=3.4
 is_python_installed $expected_python_version
 is_python_installed $expected_python_version
 [[ $? -eq 0 ]] && hasPython=1
 [[ $? -eq 0 ]] && hasPython=1
 concurrent=0
 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
         option. Also user should ensure the script permission to
         protect the script from malicious modification.
         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)
         self.logger.info(cmd)
         if not self.validateScriptFile():
         if not self.validateScriptFile():
             self.logger.error("Script file check sum does not match")
             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 threading
-import Queue
+import queue
 
 
 class ThreadWithQueue(threading.Thread):
 class ThreadWithQueue(threading.Thread):
     '''
     '''
@@ -41,7 +41,7 @@ class ThreadWithQueue(threading.Thread):
     def run(self):
     def run(self):
         while self.keepAlive:
         while self.keepAlive:
             try:
             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
                 # thread is controlled by keepAlive
                 items = self.queue.get(False, 1)
                 items = self.queue.get(False, 1)
                 func = items[0]
                 func = items[0]
@@ -49,4 +49,4 @@ class ThreadWithQueue(threading.Thread):
                 func(*args)
                 func(*args)
 
 
                 self.queue.task_done()
                 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;
 createPayload;
 
 
-expected_python_version=2.6
+expected_python_version=3.4
 is_python_installed ${expected_python_version}
 is_python_installed ${expected_python_version}
 
 
 if [ $? -eq 0 ]
 if [ $? -eq 0 ]