wsadmin with jython script gives error AttributeError: 'javapackage' object has no attribute 'SEC_SEGMENT'

500 Views Asked by At

I am running a jython script with wsadmin commands. It was running fine, until in a new unix env, it stopped working with following error:

AttributeError: 'javapackage' object has no attribute 'SEC_SEGMENT'

my test script looks like this:

 #!/usr/bin/python

 properties_file_path=sys.argv[0]
 sys.path.append(properties_file_path)

 import config
 import ast
 import datetime

 start_time=datetime.datetime.now().strftime('%H:%M:%S.%f')[:-3]
 print(start_time+"-Starting execution of script test.py")

 new_domain=config.SEC_SEGMENT['new_domain']
 print("new domain: "+new_domain)

my config properties, config.py:

 SEC_SEGMENT = {
    'new_domain': 'Domain2',# New Security Domain
 }

in other environments its working fine. Is it a library issue?

1

There are 1 best solutions below

0
Soumali Chatterjee On

Issue is resolved. There was a folder with the same name 'config' as properties file 'config.py' , under same parent directory. Due to this naming conflict of files, was getting above issue. Issue was resolved by renaming the 'config' folder