-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
20 lines (15 loc) · 799 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import sys
import logging as log
from installation_flows import setupOcpCluster, cronJobSetup
baseDir = os.path.dirname(os.path.abspath(__file__))
log.basicConfig(filename=os.path.join(baseDir, 'log', 'ocpClusterInstallation.log'), filemode='w', format='%(asctime)s - %(levelname)s - [%(filename)s:%(lineno)d] - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=log.INFO)
def main(cronExecution):
try:
executionPath = sys.executable
cronJobSetup.cronJobSetup(baseDir, executionPath) if cronExecution else setupOcpCluster.setupOcpCluster(baseDir)
log.info('!------OCP cluster setup is finished successfully------!')
except Exception as ex:
log.error("Unable to create OCP cluster: %s", ex)
if __name__ == '__main__':
main(len(sys.argv) > 1)