Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Author: Dawid Mocek
- # All rights reserved
- import os
- import sys
- import traceback
- exitonerror='true'
- stdoutDevice = sys.stdout
- class NullDevice(object):
- def write(self, s):
- pass
- #def stdoutEnable(enabled=true):
- # if enabled:
- # sys.stdout = stdoutDevice
- # else:
- # sys.stdout = NullDevice()
- #
- #
- #redirect('/dev/null', 'false')
- # sys.stdout = NullDevice()
- # sys.stderr = NullDevice()
- try:
- # print "Connecting to NodeManager " + NodeManagerListenAddress + ":" + NodeManagerListenPort + " using mode " + NodeManagerListenMode
- g = nmConnect(username = NodeManagerUser, password = NodeManagerPassword, host = NodeManagerListenAddress, port = NodeManagerListenPort,domainName= DomainName, domainDir = DomainHome, nmType = NodeManagerListenMode, verbose = 'false')
- # print "log: " + nmLog()
- sys.stdout.write('Stoping ' + AdminServerName + '... ')
- adminServerStatus = nmServerStatus(AdminServerName)
- if adminServerStatus != "RUNNING":
- raise Exception("AdminServer is in " + adminServerStatus + " state. Cannot stop")
- # http://docs.oracle.com/cd/E24329_01/web.1211/e24491/manage_servers.htm#WLSTG170
- # Using Node Manager to Start Servers on a Machine
- # 7. Stop the server by entering the nmKill command.
- nmKill(AdminServerName)
- # print "Disconnecting from NodeManager"
- except WLSTException, e:
- nmDisconnect()
- sys.exit("FAILED: " + str(e))
- except Exception, e:
- nmDisconnect()
- sys.exit("FAILED: " + e.getMessage())
- else:
- nmDisconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement