Advertisement
m4ly

WLST SuspendAdminServer.py

Aug 20th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. # Author: Dawid Mocek
  2. # All rights reserverd
  3. import java.lang
  4. import os
  5. import sys
  6. import traceback
  7.  
  8.  
  9. redirect('/dev/null', 'false')
  10.  
  11. try:
  12.  
  13.     nmConnect(NodeManagerUser, NodeManagerPassword, NodeManagerListenAddress, NodeManagerListenPort, DomainName, DomainHome, NodeManagerListenMode)
  14.     adminServerStatus = nmServerStatus(AdminServerName)
  15.  
  16.     if adminServerStatus == "RUNNING":
  17.         sys.stdout.write ('Suspending ' + AdminServerName + '... ')
  18.         suspend(sname=AdminServerName, ignodeSessions='false', timeout='180', force='true', block="true")
  19.     else:
  20.         raise Exception("AdminServer is in " + adminServerStatus + " state. Cannot suspend AdminServer")
  21.  
  22.     nmDisconnect()
  23. except Exception, e:
  24.     nmDisconnect()
  25.     sys.exit("FAILED: " + str(e))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement