xen-drbd

changeset 24:ccf4137ea2a6

print instead of exec
author igor
date Tue Feb 19 18:27:29 2008 +0200 (2008-02-19)
parents 6e01df357a6a
children 50d097b46c8d
files xen-drbd.py
line diff
     1.1 --- a/xen-drbd.py	Tue Feb 19 12:53:45 2008 +0200
     1.2 +++ b/xen-drbd.py	Tue Feb 19 18:27:29 2008 +0200
     1.3 @@ -41,11 +41,11 @@
     1.4      return output
     1.5  
     1.6  def run(command,node=i_am):
     1.7 -    run_now(command,node)
     1.8 -#   if node == i_am:
     1.9 -#       print command
    1.10 -#   else:
    1.11 -#       print "ssh %s %s < /dev/null > /dev/stderr" % (node,mkarg(command))
    1.12 +   #return run_now(command,node)
    1.13 +   if node == i_am:
    1.14 +       print command
    1.15 +   else:
    1.16 +       print "ssh %s %s < /dev/null > /dev/stderr" % (node,mkarg(command))
    1.17  
    1.18  
    1.19  def get_drbd_resources(domain):
    1.20 @@ -61,12 +61,12 @@
    1.21  def set_drbd_primary(domain, node=i_am):
    1.22      drbd_resources=get_drbd_resources(domain)
    1.23      for drbd in drbd_resources:
    1.24 -        run("drbdadm primary %s"%(drbd),node)
    1.25 +        print run("drbdadm primary %s"%(drbd),node)
    1.26  
    1.27  def set_drbd_secondary(domain, node=i_am):
    1.28      drbd_resources=get_drbd_resources(domain)
    1.29      for drbd in drbd_resources:
    1.30 -        run("drbdadm secondary %s"%(drbd),node)
    1.31 +        print run("drbdadm secondary %s"%(drbd),node)
    1.32  
    1.33  def get_domain_id(domain,node=i_am):
    1.34      """