|
34 | 34 | from wlsdeploy.aliases.model_constants import ATP_ADMIN_PASSWORD
|
35 | 35 |
|
36 | 36 | from wlsdeploy.aliases.model_constants import ATP_TNS_ENTRY
|
| 37 | +from wlsdeploy.aliases.model_constants import ATP_DB_INFO |
37 | 38 |
|
38 | 39 | from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS
|
39 | 40 | from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
|
@@ -219,23 +220,14 @@ def __run_rcu(self):
|
219 | 220 | oracle_home = self.model_context.get_oracle_home()
|
220 | 221 | java_home = self.model_context.get_java_home()
|
221 | 222 |
|
222 |
| - props_file = self.model_context.get_atp_properties_file() |
| 223 | + if self.model_context.get_atp_properties_file(): |
| 224 | + rcu_properties_map = self.model.get_model_domain_info()[ATP_DB_INFO] |
223 | 225 |
|
224 |
| - if props_file: |
225 |
| - try: |
226 |
| - rcu_properties_map = variables.load_variables(props_file) |
227 |
| - |
228 |
| - rcu_schema_pass = rcu_properties_map[ATP_RCU_SCHEMA_PASSWORD] |
229 |
| - rcu_sys_pass = rcu_properties_map[ATP_ADMIN_PASSWORD] |
230 |
| - |
231 |
| - runner = RCURunner(domain_type, oracle_home, java_home, rcu_schemas, rcu_properties_map) |
232 |
| - runner.runRcu(rcu_sys_pass, rcu_schema_pass) |
233 |
| - except VariableException, ex: |
234 |
| - self.logger.severe('WLSDPLY-20004', __program_name, ex.getLocalizedMessage(), error=ex, |
235 |
| - class_name=__class_name, method_name=_method_name) |
236 |
| - self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name) |
237 |
| - raise ex |
| 226 | + rcu_schema_pass = rcu_properties_map[ATP_RCU_SCHEMA_PASSWORD] |
| 227 | + rcu_sys_pass = rcu_properties_map[ATP_ADMIN_PASSWORD] |
238 | 228 |
|
| 229 | + runner = RCURunner(domain_type, oracle_home, java_home, rcu_schemas, rcu_properties_map) |
| 230 | + runner.runRcu(rcu_sys_pass, rcu_schema_pass) |
239 | 231 | else:
|
240 | 232 | rcu_db = self.model_context.get_rcu_database()
|
241 | 233 | rcu_prefix = self.model_context.get_rcu_prefix()
|
@@ -780,97 +772,88 @@ def __configure_fmw_infra_database(self):
|
780 | 772 | # For ATP databases : we need to set all the property for each datasource
|
781 | 773 | # load atp connection properties from properties file
|
782 | 774 | #
|
783 |
| - props_file = self.model_context.get_atp_properties_file() |
784 |
| - if props_file: |
785 |
| - try: |
786 |
| - rcu_properties_map = variables.load_variables(props_file) |
| 775 | + if self.model_context.get_atp_properties_file(): |
| 776 | + rcu_properties_map = self.model.get_model_domain_info()[ATP_DB_INFO] |
| 777 | + |
| 778 | + # parse the tnsnames.ora file and retrieve the connection string |
| 779 | + tns_admin = rcu_properties_map[DRIVER_PARAMS_NET_TNS_ADMIN] |
787 | 780 |
|
788 |
| - # parse the tnsnames.ora file and retrieve the connection string |
789 |
| - tns_admin = rcu_properties_map[DRIVER_PARAMS_NET_TNS_ADMIN] |
| 781 | + rcu_database = self._get_atp_connect_string(tns_admin + os.sep + 'tnsnames.ora', rcu_properties_map[ |
| 782 | + ATP_TNS_ENTRY]) |
790 | 783 |
|
791 |
| - rcu_database = self._get_atp_connect_string(tns_admin + os.sep + 'tnsnames.ora', rcu_properties_map[ |
792 |
| - ATP_TNS_ENTRY]) |
| 784 | + rcu_prefix = rcu_properties_map[ATP_RCU_PREFIX] |
| 785 | + rcu_schema_pwd = rcu_properties_map[ATP_RCU_SCHEMA_PASSWORD] |
793 | 786 |
|
794 |
| - rcu_prefix = rcu_properties_map[ATP_RCU_PREFIX] |
795 |
| - rcu_schema_pwd = rcu_properties_map[ATP_RCU_SCHEMA_PASSWORD] |
| 787 | + keystore_pwd = rcu_properties_map[DRIVER_PARAMS_KEYSTOREPWD_PROPERTY] |
| 788 | + truststore_pwd = rcu_properties_map[DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY] |
796 | 789 |
|
797 |
| - keystore_pwd = rcu_properties_map[DRIVER_PARAMS_KEYSTOREPWD_PROPERTY] |
798 |
| - truststore_pwd = rcu_properties_map[DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY] |
| 790 | + # Need to set for the connection proeprty for each datasource |
| 791 | + |
| 792 | + fmw_database = self.wls_helper.get_jdbc_url_from_rcu_connect_string(rcu_database) |
799 | 793 |
|
800 |
| - # Need to set for the connection proeprty for each datasource |
801 | 794 |
|
802 |
| - fmw_database = self.wls_helper.get_jdbc_url_from_rcu_connect_string(rcu_database) |
| 795 | + location = LocationContext() |
| 796 | + location.append_location(JDBC_SYSTEM_RESOURCE) |
803 | 797 |
|
| 798 | + folder_path = self.alias_helper.get_wlst_list_path(location) |
| 799 | + self.wlst_helper.cd(folder_path) |
| 800 | + ds_names = self.wlst_helper.lsc() |
804 | 801 |
|
| 802 | + for ds_name in ds_names: |
805 | 803 | location = LocationContext()
|
806 | 804 | location.append_location(JDBC_SYSTEM_RESOURCE)
|
807 |
| - |
808 |
| - folder_path = self.alias_helper.get_wlst_list_path(location) |
809 |
| - self.wlst_helper.cd(folder_path) |
810 |
| - ds_names = self.wlst_helper.lsc() |
811 |
| - |
812 |
| - for ds_name in ds_names: |
813 |
| - location = LocationContext() |
814 |
| - location.append_location(JDBC_SYSTEM_RESOURCE) |
815 |
| - token_name = self.alias_helper.get_name_token(location) |
816 |
| - location.add_name_token(token_name, ds_name) |
817 |
| - |
818 |
| - |
819 |
| - location.append_location(JDBC_RESOURCE) |
820 |
| - location.append_location(JDBC_DRIVER_PARAMS) |
821 |
| - wlst_path = self.alias_helper.get_wlst_attributes_path(location) |
822 |
| - self.wlst_helper.cd(wlst_path) |
823 |
| - |
824 |
| - wlst_name, wlst_value = \ |
825 |
| - self.alias_helper.get_wlst_attribute_name_and_value(location, URL, fmw_database) |
826 |
| - self.wlst_helper.set_if_needed(wlst_name, wlst_value, JDBC_DRIVER_PARAMS, ds_name) |
827 |
| - |
828 |
| - wlst_name, wlst_value = \ |
829 |
| - self.alias_helper.get_wlst_attribute_name_and_value(location, PASSWORD_ENCRYPTED, |
830 |
| - rcu_schema_pwd, masked=True) |
831 |
| - self.wlst_helper.set_if_needed(wlst_name, wlst_value, JDBC_DRIVER_PARAMS, ds_name, masked=True) |
832 |
| - |
833 |
| - location.append_location(JDBC_DRIVER_PARAMS_PROPERTIES) |
834 |
| - token_name = self.alias_helper.get_name_token(location) |
835 |
| - if token_name is not None: |
836 |
| - location.add_name_token(token_name, DRIVER_PARAMS_USER_PROPERTY) |
837 |
| - |
838 |
| - wlst_path = self.alias_helper.get_wlst_attributes_path(location) |
839 |
| - self.wlst_helper.cd(wlst_path) |
840 |
| - orig_user = self.wlst_helper.get('Value') |
841 |
| - stb_user = orig_user.replace('DEV', rcu_prefix) |
842 |
| - wlst_name, wlst_value = \ |
843 |
| - self.alias_helper.get_wlst_attribute_name_and_value(location, DRIVER_PARAMS_PROPERTY_VALUE, |
844 |
| - stb_user) |
845 |
| - self.wlst_helper.set_if_needed(wlst_name, wlst_value, |
846 |
| - JDBC_DRIVER_PARAMS_PROPERTIES, DRIVER_PARAMS_USER_PROPERTY) |
847 |
| - |
848 |
| - # need to set other properties |
849 |
| - |
850 |
| - location.remove_name_token(DRIVER_PARAMS_USER_PROPERTY) |
851 |
| - |
852 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_kEYSTORE_PROPERTY, tns_admin + os.sep |
853 |
| - + 'keystore.jks') |
854 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_KEYSTORETYPE_PROPERTY, |
855 |
| - 'JKS') |
856 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_KEYSTOREPWD_PROPERTY, keystore_pwd) |
857 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_TRUSTSTORE_PROPERTY, tns_admin + os.sep |
858 |
| - + 'truststore.jks') |
859 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY, |
860 |
| - 'JKS') |
861 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY, truststore_pwd) |
862 |
| - |
863 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_SSL_VERSION, '1.2') |
864 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY, 'true') |
865 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_TNS_ADMIN, tns_admin) |
866 |
| - self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_FAN_ENABLED, 'false') |
867 |
| - |
868 |
| - except VariableException, ex: |
869 |
| - self.logger.severe('WLSDPLY-20004', _program_name, ex.getLocalizedMessage(), error=ex, |
870 |
| - class_name=_class_name, method_name=_method_name) |
871 |
| - self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name) |
872 |
| - raise ex |
873 |
| - |
| 805 | + token_name = self.alias_helper.get_name_token(location) |
| 806 | + location.add_name_token(token_name, ds_name) |
| 807 | + |
| 808 | + |
| 809 | + location.append_location(JDBC_RESOURCE) |
| 810 | + location.append_location(JDBC_DRIVER_PARAMS) |
| 811 | + wlst_path = self.alias_helper.get_wlst_attributes_path(location) |
| 812 | + self.wlst_helper.cd(wlst_path) |
| 813 | + |
| 814 | + wlst_name, wlst_value = \ |
| 815 | + self.alias_helper.get_wlst_attribute_name_and_value(location, URL, fmw_database) |
| 816 | + self.wlst_helper.set_if_needed(wlst_name, wlst_value, JDBC_DRIVER_PARAMS, ds_name) |
| 817 | + |
| 818 | + wlst_name, wlst_value = \ |
| 819 | + self.alias_helper.get_wlst_attribute_name_and_value(location, PASSWORD_ENCRYPTED, |
| 820 | + rcu_schema_pwd, masked=True) |
| 821 | + self.wlst_helper.set_if_needed(wlst_name, wlst_value, JDBC_DRIVER_PARAMS, ds_name, masked=True) |
| 822 | + |
| 823 | + location.append_location(JDBC_DRIVER_PARAMS_PROPERTIES) |
| 824 | + token_name = self.alias_helper.get_name_token(location) |
| 825 | + if token_name is not None: |
| 826 | + location.add_name_token(token_name, DRIVER_PARAMS_USER_PROPERTY) |
| 827 | + |
| 828 | + wlst_path = self.alias_helper.get_wlst_attributes_path(location) |
| 829 | + self.wlst_helper.cd(wlst_path) |
| 830 | + orig_user = self.wlst_helper.get('Value') |
| 831 | + stb_user = orig_user.replace('DEV', rcu_prefix) |
| 832 | + wlst_name, wlst_value = \ |
| 833 | + self.alias_helper.get_wlst_attribute_name_and_value(location, DRIVER_PARAMS_PROPERTY_VALUE, |
| 834 | + stb_user) |
| 835 | + self.wlst_helper.set_if_needed(wlst_name, wlst_value, |
| 836 | + JDBC_DRIVER_PARAMS_PROPERTIES, DRIVER_PARAMS_USER_PROPERTY) |
| 837 | + |
| 838 | + # need to set other properties |
| 839 | + |
| 840 | + location.remove_name_token(DRIVER_PARAMS_USER_PROPERTY) |
| 841 | + |
| 842 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_kEYSTORE_PROPERTY, tns_admin + os.sep |
| 843 | + + 'keystore.jks') |
| 844 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_KEYSTORETYPE_PROPERTY, |
| 845 | + 'JKS') |
| 846 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_KEYSTOREPWD_PROPERTY, keystore_pwd) |
| 847 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_TRUSTSTORE_PROPERTY, tns_admin + os.sep |
| 848 | + + 'truststore.jks') |
| 849 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY, |
| 850 | + 'JKS') |
| 851 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY, truststore_pwd) |
| 852 | + |
| 853 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_SSL_VERSION, '1.2') |
| 854 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY, 'true') |
| 855 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_TNS_ADMIN, tns_admin) |
| 856 | + self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_FAN_ENABLED, 'false') |
874 | 857 | else:
|
875 | 858 | rcu_database = self.model_context.get_rcu_database()
|
876 | 859 | if rcu_database is None:
|
|
0 commit comments