-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathucAppConfig.py
More file actions
85 lines (70 loc) · 3.42 KB
/
Copy pathucAppConfig.py
File metadata and controls
85 lines (70 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3.6
__version__ = '0.4'
__author__ = 'Christopher Phillips'
import os # directories
import logging # debug
from appConfig import appConfig
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler('ucAppConfigDebug.log', mode='w')
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - \
%(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.info("Begin ucAppConfig Logging")
class ccmAppConfig(appConfig):
# holds config data for connection to UC Apps
# default /axlsqltoolkit/schema/current/AXLAPI.wsdl
_wsdlFileName = 'axlsqltoolkit/schema/11.0/AXLAPI.wsdl'
def __init__(self, cfgFileName):
appConfig.__init__(self, cfgFileName)
self._appCfgFileName = cfgFileName
appCfgFileFound = self.checkFileExists(self._appCfgFileName,
self._localDir)
if not appCfgFileFound:
print("The specified Config file was not found.")
print("Generate a new config file using configCreator.py")
raise Exception("Config File NOT found. Unrecoverable error.")
self._appCfgFileName = os.path.join(self._localDir,
self._appCfgFileName)
self._loadAppCfgFile(self._appCfgFileName)
if 'ucm' in self._appCfgFileName:
wsdlFileFound = self.checkFileExists(self._wsdlFileName,
self._localDir)
if not wsdlFileFound:
logger.error("This version of cucmAxlWriter is expecting" +
" the UCM 11.5 WSDL file.")
logger.error("If you choose to use a different version of" +
"the WSDL your results may vary.")
logger.error("The 11.5 version WSDL file must be placed in %s",
os.path.join(self._localDir,
self._wsdlFileName))
raise Exception("WSDL File NOT found. Unrecoverable error.")
else:
self._wsdlFileName = os.path.join(self._localDir,
self._wsdlFileName)
def getwsdlFileName(self):
return self._wsdlFileName
def getAppApiUrl(self):
return 'https://{0}:8443/axl/'.format(self.getAppHost())
def _setAppUrl(self, ipOrHostname):
self._appUrl = ipOrHostname
class cxnAppConfig(appConfig):
# holds config data for connection to UC Apps
def __init__(self, cfgFileName):
appConfig.__init__(self, cfgFileName)
self._appCfgFileName = cfgFileName
appCfgFileFound = self.checkFileExists(self._appCfgFileName,
self._localDir)
if not appCfgFileFound:
print("The specified Config file was not found.")
print("Generate a new config file using configCreator.py")
raise Exception("Config File NOT found. Unrecoverable error.")
self._appCfgFileName = os.path.join(self._localDir,
self._appCfgFileName)
self._loadAppCfgFile(self._appCfgFileName)
def getAppApiUrl(self):
return 'https://{0}/vmrest/'.format(self.getAppHost())
def _setAppUrl(self, ipOrHostname):
self._appUrl = ipOrHostname