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