Skip to content

Wdt support for 1411 #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fba6c30
Add unit test and fixes found by testing
CarolynRountree Oct 4, 2019
1dbf12a
validation support for unicode
CarolynRountree Oct 9, 2019
b5abc97
Between fixes of 2.2.1 and 2.7.1
CarolynRountree Oct 17, 2019
caf45ec
Change pom for unit tests to pull in correct jython version
CarolynRountree Oct 17, 2019
14b5c23
change scripts to support jdk 10 and jdk 11
CarolynRountree Oct 17, 2019
e718009
Fix Java version checking in shell scripts
CarolynRountree Oct 18, 2019
9a13bd0
message for jrf in 14.1.1 no supported and pom changes
CarolynRountree Oct 18, 2019
1f9c751
updated shell scripts to support JDK greater than 1.8
ddsharpe Oct 18, 2019
9888b4c
toString no longer exists in Jython 2.7.1
ddsharpe Oct 18, 2019
793cccf
remove prints and change pom
CarolynRountree Oct 18, 2019
97502aa
Merge branch 'WDT-Support-for-1411' of github.com:oracle/weblogic-dep…
CarolynRountree Oct 18, 2019
5225515
Merge branch 'master' into WDT-Support-for-1411
CarolynRountree Oct 18, 2019
df00212
remove Vector related additions
CarolynRountree Oct 18, 2019
756d90c
Merge branch 'master' into WDT-Support-for-1411
ddsharpe Oct 19, 2019
ab964d8
reverted jython properties change
ddsharpe Oct 19, 2019
c31067c
save log files to debug problem in system test
CarolynRountree Oct 21, 2019
289aae6
Merge branch 'WDT-Support-for-1411' of github.com:oracle/weblogic-dep…
CarolynRountree Oct 21, 2019
6cfca2f
correct leftover code
CarolynRountree Oct 21, 2019
e7cbe8e
correct leftover code
CarolynRountree Oct 21, 2019
aaf99f8
revert code to extract provider class name
CarolynRountree Oct 22, 2019
cf55ab2
massage code for saving logs in workspace for the system test
CarolynRountree Oct 22, 2019
89d69ee
massage code for saving logs in workspace for the system test
CarolynRountree Oct 22, 2019
e1793ff
revert save logs and move to different PR
CarolynRountree Oct 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ public void __setitem__(PyObject key, PyObject value) {
synchronized (this.linkedHashMap) {
this.linkedHashMap.put(key, value);
}
synchronized (super.table) {
super.table.put(key, value);
}
// do not access protected field directly.
// 2.7 version does not have table variable.
// Neither version has synchronization on the table.
super.__setitem__(key, value);
}

/**
Expand All @@ -291,7 +292,7 @@ public void __setitem__(PyObject key, PyObject value) {
@Override
public void clear() {
this.linkedHashMap.clear();
super.table.clear();;
super.clear();
}

/**
Expand Down Expand Up @@ -503,6 +504,7 @@ private static PyObject doDeepCopy(PyObject orig, PyObject memo) {
case "long":
case "NoneType":
case "str":
case "unicode":
result = orig;
break;

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/python/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The main module for the WLSDeploy tool to create empty domains.
"""
import javaos as os
import os
import sys
from java.io import IOException
from java.lang import IllegalArgumentException
Expand Down Expand Up @@ -487,6 +487,6 @@ def main(args):
return


if __name__ == "main":
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
4 changes: 2 additions & 2 deletions core/src/main/python/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The entry point for the deployApps tool.
"""
import javaos as os
import os
import sys

from java.io import IOException, PrintStream
Expand Down Expand Up @@ -437,6 +437,6 @@ def main(args):
return


if __name__ == "main":
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
4 changes: 2 additions & 2 deletions core/src/main/python/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The entry point for the discoverDomain tool.
"""
import javaos as os
import os
import sys

from java.io import File
Expand Down Expand Up @@ -525,6 +525,6 @@ def main(args):

__log_and_exit(model_context, exit_code, _class_name, _method_name)

if __name__ == 'main':
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
4 changes: 2 additions & 2 deletions core/src/main/python/encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The main module for the WLSDeploy tool to encrypt passwords.
"""
import javaos as os
import os
import sys

from java.io import IOException
Expand Down Expand Up @@ -285,6 +285,6 @@ def main(args):
sys.exit(exit_code)


if __name__ == "main":
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
4 changes: 2 additions & 2 deletions core/src/main/python/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The entry point for the updateDomain tool.
"""
import javaos as os
import os
import sys

from java.io import IOException, PrintStream
Expand Down Expand Up @@ -454,6 +454,6 @@ def main(args):
return


if __name__ == "main":
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
4 changes: 2 additions & 2 deletions core/src/main/python/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The WLS Deploy tooling entry point for the validateModel tool.
"""
import javaos as os
import os
import sys
from java.util.logging import Level

Expand Down Expand Up @@ -254,6 +254,6 @@ def main(args):
return


if __name__ == "main":
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
2 changes: 1 addition & 1 deletion core/src/main/python/variable_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,6 @@ def main(args):
__logger.exiting(result=exit_code, class_name=_class_name, method_name=_method_name)
sys.exit(exit_code)

if __name__ == 'main':
if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
main(sys.argv)
12 changes: 6 additions & 6 deletions core/src/main/python/wlsdeploy/aliases/alias_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ def merge_model_and_existing_lists(model_list, existing_list, string_list_separa
result = model_list
elif model_list is None or len(model_list) == 0:
result = existing_list
if type(model_list) is str and type(existing_list) is not str:
if isinstance(model_list, basestring) and not isinstance(existing_list, basestring):
result = string_list_separator_char.join(existing_list)
else:
model_list_is_string = type(model_list) is str
model_list_is_string = isinstance(model_list, basestring)
model_set = _create_set(model_list, string_list_separator_char, 'WLSDPLY-08000')
existing_set = _create_set(existing_list, string_list_separator_char, 'WLSDPLY-08001')

Expand Down Expand Up @@ -107,7 +107,7 @@ def merge_model_and_existing_properties(model_props, existing_props, string_prop
result = model_props
elif model_props is None or len(model_props) == 0:
result = existing_props
if type(model_props) is str and type(existing_props) is not str:
if isinstance(model_props, basestring) and isinstance(existing_props, basestring):
result = _properties_to_string(existing_props, string_props_separator_char)
else:
model_props_is_string = False
Expand Down Expand Up @@ -517,7 +517,7 @@ def convert_boolean(value):
result = True
elif value == 0:
result = False
elif type(value) is str:
elif isinstance(value, basestring):
if value.lower() == 'true':
result = True
elif value.lower() == 'false':
Expand Down Expand Up @@ -844,7 +844,7 @@ def _get_path_separator(value):
_logger.entering(value, class_name=_class_name, method_name=_method_name)

result = File.pathSeparator
if type(value) is str and len(value) > 0:
if isinstance(value, basestring) and len(value) > 0:
# If the value has a windows separator or a single directory that starts with a drive letter
if ';' in value or _windows_path_regex.match(value):
result = ';'
Expand Down Expand Up @@ -972,7 +972,7 @@ def _properties_to_string(props, string_props_separator_char):
_logger.entering(props, string_props_separator_char, class_name=_class_name, method_name=_method_name)
if props is None:
result = ''
elif type(props) is str:
elif isinstance(props, basestring):
result = props
else:
result = ''
Expand Down
11 changes: 7 additions & 4 deletions core/src/main/python/wlsdeploy/json/json_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

This model provider translation classes that convert between JSON and Python Dictionaries.
"""
import types

import java.io.FileNotFoundException as JFileNotFoundException
import java.io.FileOutputStream as JFileOutputStream
import java.io.IOException as JIOException
Expand Down Expand Up @@ -202,21 +204,22 @@ def _format_json_value(value):
"""
import java.lang.StringBuilder as StringBuilder
builder = StringBuilder()
if type(value) == bool or (type(value) == str and (value == 'true' or value == 'false')):
if type(value) == bool or (isinstance(value, types.StringTypes) and (value == 'true' or value == 'false')):
builder.append(JBoolean.toString(value))
elif type(value) == str:
builder.append('"').append(_quote_embedded_quotes(value)).append('"')
elif isinstance(value, types.StringTypes):
builder.append('"').append(_quote_embedded_quotes(value.strip())).append('"')
else:
builder.append(value)
return builder.toString()


def _quote_embedded_quotes(text):
"""
Quote all embedded double quotes in a string with a backslash.
:param text: the text to quote
:return: the quotes result
"""
result = text
if type(text) is str and '"' in text:
if isinstance(text, types.StringTypes) and '"' in text:
result = text.replace('"', '\\"')
return result
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import javaos as os
import os
import weblogic.security.internal.SerializedSystemIni as SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService as ClearOrEncryptedService
from java.io import FileOutputStream
Expand Down
8 changes: 7 additions & 1 deletion core/src/main/python/wlsdeploy/tool/create/domain_typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import javaos as os
import os
import re

from java.lang import IllegalArgumentException
Expand All @@ -18,6 +18,7 @@

CREATE_DOMAIN = 'createDomain'
UPDATE_DOMAIN = 'updateDomain'
NOT_SUPPORTED = 'NOT_SUPPORTED'


class DomainTypedef(object):
Expand Down Expand Up @@ -370,6 +371,7 @@ def __get_version_typedef(self):
raise ex

self._version_typedef_name = self.__match_version_typedef(self._domain_typedefs_dict['versions'])

if self._version_typedef_name in self._domain_typedefs_dict['definitions']:
result = self._domain_typedefs_dict['definitions'][self._version_typedef_name]
else:
Expand Down Expand Up @@ -417,6 +419,10 @@ def __match_version_typedef(self, versions_dict):
self._domain_typedef_filename, wls_version)
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
raise ex
if result == NOT_SUPPORTED:
ex = exception_helper.create_create_exception('WLSDPLY-12313', self._domain_type, wls_version)
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
raise ex
self._logger.exiting(self.__class_name, _method_name, result)
return result

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import copy
import javaos as os
import os
from java.io import ByteArrayOutputStream
from java.io import File
from java.io import FileNotFoundException
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/python/wlsdeploy/tool/deploy/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import javaos as os
import os

from array import array
from java.lang import Class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,18 @@ def equal_jarrays(array1, array2):
return False


def security_provider_interface_name(mbean_interface):
def security_provider_interface_name(mbean_interface_name):
"""
Return the name that is used to look up the custom Security Provider MBeanInfo.

This is too tightly coupled to be in this class.
This needs something more to differentiate Security Provider Interface which is formatted differently from other
custom MBean Interface names.
:param mbean_interface: interface for the MBean
:return: massaged name specific to the Scurity Provider
:param mbean_interface_name: interface for the MBean
:return: provider class name returned from the massaged MBean name
"""
result = mbean_interface
idx = mbean_interface.rfind('MBean')
result = mbean_interface_name
idx = mbean_interface_name.rfind('MBean')
if idx > 0:
result = result[:idx]
return result
Expand Down Expand Up @@ -422,7 +422,7 @@ def is_empty(value):
:return: True if the attribute does not contain a value
"""
return value is None or (type(value) in [list, dict] and len(value) == 0) or \
((type(value) == str or isinstance(value, String)) and
((isinstance(value, basestring) or isinstance(value, String)) and
(len(value) == 0 or value == '[]' or value == 'null' or value == 'None'))


Expand Down
4 changes: 2 additions & 2 deletions core/src/main/python/wlsdeploy/tool/discover/discoverer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import javaos as os
import os

from oracle.weblogic.deploy.aliases import AliasException
from oracle.weblogic.deploy.discover import DiscoverException
Expand Down Expand Up @@ -612,7 +612,7 @@ def _find_mbean_interface(self, location, interfaces):
_method_name = '_find_mbean_interface'
mbean_name = None
for interface in interfaces:
interface_name = str(interface)
interface_name = str(interface.getTypeName())
if 'MBean' in interface_name:
_logger.finer('WLSDPLY-06126', interface_name, self._alias_helper.get_model_folder_path(location),
class_name=_class_name, method_name=_method_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import javaos as os
import os

from java.io import File

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/python/wlsdeploy/tool/util/filter_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import imp
import javaos as os
import os
import sys

from wlsdeploy.logging.platform_logger import PlatformLogger
Expand Down
Loading