def __init__(self): super(JDKSetupLinux, self).__init__() self.JDK_DEFAULT_CONFIGS = [ JDKRelease( "jdk1.8", "Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8", "http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u60-linux-x64.tar.gz", "jdk-8u60-linux-x64.tar.gz", "http://public-repo-1.hortonworks.com/ARTIFACTS/jce_policy-8.zip", "jce_policy-8.zip", AmbariPath.get("/usr/jdk64/jdk1.8.0_40"), "(jdk.*)/jre") ] self.jdks = self.JDK_DEFAULT_CONFIGS self.custom_jdk_number = len(self.jdks) self.JAVA_BIN = "java" self.CREATE_JDK_DIR_CMD = "/bin/mkdir -p {0}" self.CHMOD_JDK_DIR_CMD = "chmod a+x {0}" self.SET_JCE_PERMISSIONS = "chown {0} {1}/{2}/*" self.SET_JCE_JAR_MODE = "chmod 664 {0}/{1}/{2}" self.SET_JCE_FILE_MODE = "chmod 644 {0}/{1}/{2}" # use --no-same-owner when running as root to prevent uucp as the user (AMBARI-6478) self.UNTAR_JDK_ARCHIVE = "tar --no-same-owner -xvf {0}"
def _populate_jdk_configs(self, properties, jdk_num): if properties.has_key(JDK_RELEASES): jdk_names = properties[JDK_RELEASES].split(',') jdk_names = filter(None, jdk_names) jdks = [] for jdk_name in jdk_names: jdkR = JDKRelease.from_properties(properties, jdk_name) jdks.append(jdkR) else: jdks = self.JDK_DEFAULT_CONFIGS n_config = 1 jdk_choice_prompt = '' jdk_choices = '' for jdk in jdks: jdk_choice_prompt += self.JDK_PROMPT.format(n_config, jdk.desc) jdk_choices += str(n_config) n_config += 1 jdk_choice_prompt += self.JDK_CUSTOM_CHOICE_PROMPT.format( n_config, jdk_num) jdk_valid_choices = self.JDK_VALID_CHOICES.format( jdk_choices, n_config) return jdks, jdk_choice_prompt, jdk_valid_choices, n_config - 1
def _populate_jdk_configs(self, properties, jdk_num, ambariOnly = False): def remove_jdk_condition(name): """ Removes jdk1.7 from the default choices. This method can be removed if JDK 7 support (for stack services) will be dropped. """ if name != "jdk1.7": return True else: print "JDK 7 detected. Removed from choices." return False if properties.has_key(JDK_RELEASES): jdk_names = properties[JDK_RELEASES].split(',') jdk_names = filter(None, jdk_names) if ambariOnly: jdk_names = filter(lambda x : remove_jdk_condition(x), jdk_names) jdks = [] for jdk_name in jdk_names: jdkR = JDKRelease.from_properties(properties, jdk_name) jdks.append(jdkR) else: jdks = self.JDK_DEFAULT_CONFIGS n_config = 1 jdk_choice_prompt = '' jdk_choices = '' for jdk in jdks: jdk_choice_prompt += self.JDK_PROMPT.format(n_config, jdk.desc) jdk_choices += str(n_config) n_config += 1 jdk_choice_prompt += self.JDK_CUSTOM_CHOICE_PROMPT.format(n_config, jdk_num) jdk_valid_choices = self.JDK_VALID_CHOICES.format(jdk_choices, n_config) return jdks, jdk_choice_prompt, jdk_valid_choices, n_config - 1
def __init__(self): super(JDKSetupWindows, self).__init__() self.JDK_DEFAULT_CONFIGS = [ JDKRelease("jdk7.67", "Oracle JDK 1.7.67", "http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-7u67-windows-x64.exe", "jdk-7u67-windows-x64.exe", "http://public-repo-1.hortonworks.com/ARTIFACTS/UnlimitedJCEPolicyJDK7.zip", "UnlimitedJCEPolicyJDK7.zip", "C:\\jdk1.7.0_67", "Creating (jdk.*)/jre") ] self.jdks = self.JDK_DEFAULT_CONFIGS self.custom_jdk_number = len(self.jdks) self.JAVA_BIN = "java.exe"
def __init__(self): super(JDKSetupLinux, self).__init__() self.JDK_DEFAULT_CONFIGS = [ JDKRelease("jdk6.31", "Oracle JDK 1.6", "http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-6u31-linux-x64.bin", "jdk-6u31-linux-x64.bin", "http://public-repo-1.hortonworks.com/ARTIFACTS/jce_policy-6.zip", "jce_policy-6.zip", "/usr/jdk64/jdk1.6.0_31", "Creating (jdk.*)/jre") ] self.jdks = self.JDK_DEFAULT_CONFIGS self.custom_jdk_number = len(self.jdks) self.JAVA_BIN = "java" self.CREATE_JDK_DIR_CMD = "/bin/mkdir -p {0}" self.MAKE_FILE_EXECUTABLE_CMD = "chmod a+x {0}" # use --no-same-owner when running as root to prevent uucp as the user (AMBARI-6478) self.UNTAR_JDK_ARCHIVE = "tar --no-same-owner -xvf {0}"
def __init__(self): super(JDKSetupLinux, self).__init__() self.JDK_DEFAULT_CONFIGS = [ JDKRelease("jdk1.8", "Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8", "https://storage.googleapis.com/arenadata-repo/ADH/1.4.0/jdk/jdk-8u131-linux-x64.tar.gz", "jdk-8u131-linux-x64.tar.gz", "https://storage.googleapis.com/arenadata-repo/ADH/1.4.0/jdk/jce_policy-8.zip", "jce_policy-8.zip", "/usr/jdk64/jdk1.8.0_131", "(jdk.*)/jre") ] self.jdks = self.JDK_DEFAULT_CONFIGS self.custom_jdk_number = len(self.jdks) self.JAVA_BIN = "java" self.CREATE_JDK_DIR_CMD = "/bin/mkdir -p {0}" self.CHMOD_JDK_DIR_CMD = "chmod a+x {0}" self.SET_JCE_PERMISSIONS = "chown {0} {1}/{2}/*" # use --no-same-owner when running as root to prevent uucp as the user (AMBARI-6478) self.UNTAR_JDK_ARCHIVE = "tar --no-same-owner -xvf {0}"
def _populate_jdk_configs(self, properties, jdk_num): if properties.has_key(JDK_RELEASES): jdk_names = properties[JDK_RELEASES].split(',') jdks = [] for jdk_name in jdk_names: jdkR = JDKRelease.from_properties(properties, jdk_name) jdks.append(jdkR) else: jdks = self.JDK_DEFAULT_CONFIGS n_config = 1 jdk_choice_prompt = '' jdk_choices = '' for jdk in jdks: jdk_choice_prompt += self.JDK_PROMPT.format(n_config, jdk.desc) jdk_choices += str(n_config) n_config += 1 jdk_choice_prompt += self.JDK_CUSTOM_CHOICE_PROMPT.format(n_config, jdk_num) jdk_valid_choices = self.JDK_VALID_CHOICES.format(jdk_choices, n_config) return jdks, jdk_choice_prompt, jdk_valid_choices, n_config - 1