~lazypower/charms/trusty/nexentaedge-swift-gw/metadata-typo

« back to all changes in this revision

Viewing changes to hooks/configurationSteps/nedeployInstall.py

  • Committer: anton.skriptsov at nexenta
  • Date: 2016-01-18 15:50:23 UTC
  • Revision ID: anton.skriptsov@nexenta.com-20160118155023-w3u8z31tvcnaaf6o
add error output to charm log

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import traceback
2
1
import subprocess
3
2
 
4
3
from settings import Settings
27
26
        print("\texclude        : {}".format(exclude))
28
27
        print("\treserved       : {}".format(reserved))
29
28
 
30
 
        try:
31
 
 
32
 
            neadmCmd = [Settings.NEDEPLOY_CMD, 'deploy', 'solo',
33
 
                        node_private_ip, 'nexenta:nexenta', '-i',
34
 
                        replicast_eth]
35
 
 
36
 
            if node_type == 'mgmt':
37
 
                neadmCmd.append('-m')
38
 
            elif node_type == 'gateway':
39
 
                # ADD GATEWAY parameter to deploy solo cmd
40
 
                print("Gateway type selected!! ")
41
 
 
42
 
            # profile section
43
 
            neadmCmd.append('-t')
44
 
            if profile.lower() == 'balanced':
45
 
                neadmCmd.append('balanced')
46
 
            elif profile.lower() == 'performance':
47
 
                neadmCmd.append('performance')
48
 
            else:
49
 
                neadmCmd.append('capacity')
50
 
 
51
 
            if nodocker is True:
52
 
                neadmCmd.append('--nodocker')
53
 
 
54
 
            if exclude:
55
 
                neadmCmd.append('-x')
56
 
                neadmCmd.append(exclude)
57
 
 
58
 
            if reserved:
59
 
                neadmCmd.append('-X')
60
 
                neadmCmd.append(reserved)
61
 
 
62
 
            print("NEDEPLOY cmd is: {0}".format(' '.join(neadmCmd)))
63
 
            subprocess.check_output(neadmCmd)
64
 
 
65
 
        except Exception as ex:
66
 
            raise Exception('in {0}\nMessage:{1}\nTrace: {2}'.format(
67
 
                self.__class__.__name__, ex.message, traceback.format_exc()))
 
29
        neadmCmd = [Settings.NEDEPLOY_CMD, 'deploy', 'solo',
 
30
                    node_private_ip, 'nexenta:nexenta', '-i',
 
31
                    replicast_eth]
 
32
 
 
33
        if node_type == 'mgmt':
 
34
            neadmCmd.append('-m')
 
35
        elif node_type == 'gateway':
 
36
            # ADD GATEWAY parameter to deploy solo cmd
 
37
            print("Gateway type selected!! ")
 
38
 
 
39
        # profile section
 
40
        neadmCmd.append('-t')
 
41
        if profile.lower() == 'balanced':
 
42
            neadmCmd.append('balanced')
 
43
        elif profile.lower() == 'performance':
 
44
            neadmCmd.append('performance')
 
45
        else:
 
46
            neadmCmd.append('capacity')
 
47
 
 
48
        if nodocker is True:
 
49
            neadmCmd.append('--nodocker')
 
50
 
 
51
        if exclude:
 
52
            neadmCmd.append('-x')
 
53
            neadmCmd.append(exclude)
 
54
 
 
55
        if reserved:
 
56
            neadmCmd.append('-X')
 
57
            neadmCmd.append(reserved)
 
58
 
 
59
        print("NEDEPLOY cmd is: {0}".format(' '.join(neadmCmd)))
 
60
        subprocess.check_output(neadmCmd,
 
61
                                stderr=subprocess.STDOUT,
 
62
                                universal_newlines=True)