8
from settings import Settings
9
from baseConfigurationStep import BaseConfigurationStep
11
class NedeployInstall(BaseConfigurationStep):
15
def process(self, environment):
16
node_public_ip = environment['node_public_ip']
17
node_type = environment['node_type']
18
replicast_eth = environment['replicast_eth']
19
nodocker = environment['nodocker']
20
profile = environment['profile']
21
exclude = environment['exclude']
22
reserved = environment['reserved']
24
print('[{}]'.format(self.__class__.__name__))
25
print("\tnode_public_ip : {}".format(node_public_ip))
26
print("\tnode_type : {}".format(node_type))
27
print("\treplicast_eth : {}".format(replicast_eth))
28
print("\tnodocker : {}".format(nodocker))
29
print("\tprofile : {}".format(profile))
30
print("\texclude : {}".format(exclude))
31
print("\treserved : {}".format(reserved))
35
neadmCmd = [Settings.NEDEPLOY_CMD, 'deploy', 'solo', node_public_ip, 'nexenta:nexenta', '-i', replicast_eth]
37
if node_type == 'mgmt':
39
elif node_type == 'gateway':
40
#ADD GATEWAY parameter to deploy solo cmd
41
print("Gateway type selected!! ")
45
if profile.lower() == 'balanced':
46
neadmCmd.append('balanced')
47
elif profile.lower() == 'performance':
48
neadmCmd.append('performance')
50
neadmCmd.append('capacity')
52
if nodocker and nodocker == True:
53
neadmCmd.append('--nodocker')
57
neadmCmd.append(exclude)
61
neadmCmd.append(reserved)
63
print("NEDEPLOY cmd is: {0}".format(' '.join(neadmCmd)))
64
output = subprocess.check_output(neadmCmd)
66
except Exception as ex:
67
raise Exception('in {0}\nMessage:{1}\nTrace: {2}'.format(self.__class__.__name__, ex.message, traceback.format_exc()))