Re: [Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: tools by zhenh from

2006-04-18 Thread Andrew Beekhof


On Apr 18, 2006, at 12:08 PM, David Lee wrote:


On Wed, 12 Apr 2006, Andrew Beekhof wrote:


On 4/12/06, linux-ha-cvs@lists.linux-ha.org
linux-ha-cvs@lists.linux-ha.org wrote:

linux-ha CVS committal

Author  : zhenh
Host:
Project : linux-ha
Module  : tools

Dir : linux-ha/tools


Modified Files:
haresources2cib.py.in


Log Message:
generate the cib in the final place with right permission


perfect


===
RCS file: /home/cvs/linux-ha/linux-ha/tools/haresources2cib.py.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- haresources2cib.py.in   12 Apr 2006 05:55:33 -  1.9
+++ haresources2cib.py.in   12 Apr 2006 08:58:24 -  1.10
@@ -338,6 +338,8 @@
 if __name__==__main__ :
resource_file = /etc/ha.d/haresources
config_file = /etc/ha.d/ha.cf
+   target_file = /var/lib/heartbeat/crm/cib.xml
+   to_stdout = False

[...]


Absolute path-names?  Doesn't feel right.  (We're in a .in file,  
so we

should be able to abstract these into @...@ things.)


ah, you're right.  not so perfect :-(





[...]
+   elif os.access(target_file, os.F_OK) or os.access 
(target_file+.sig, os.F_OK) :
+   sys.stderr.write(cib.xml or cib.xml.sig exist  
in /var/lib/heartbeat/crm/\n)
+   sys.stderr.write(please remove them before  
generating new cib.xml\n)

[...]


And another.

Could someone take a look?  (I could do myself in a few days if you  
wish.)


--

:  David LeeI.T. Service  :
:  Senior Systems ProgrammerComputer Centre   :
:   Durham University :
:  http://www.dur.ac.uk/t.d.lee/South Road:
:   Durham DH1 3LE:
:  Phone: +44 191 334 2752  U.K.  :
___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


--
Andrew Beekhof

I'd find myself if I knew where myself left me - MGF


___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


Re: [Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: tools by zhenh from

2006-04-18 Thread David Lee
On Tue, 18 Apr 2006, Andrew Beekhof wrote:

 On Apr 18, 2006, at 12:08 PM, David Lee wrote:

  On Wed, 12 Apr 2006, Andrew Beekhof wrote:
 
  [...]
  config_file = /etc/ha.d/ha.cf
  +   target_file = /var/lib/heartbeat/crm/cib.xml
  +   to_stdout = False
  [...]
 
  Absolute path-names?  Doesn't feel right.  (We're in a .in file,
  so we
  should be able to abstract these into @...@ things.)

 ah, you're right.  not so perfect :-(

So: you, or me, or A.N. Other (zhenh?) to fix?

I'd be happiest if it wasn't me.  (And I'm still officially on holiday!)
But I'm willing to do it if that's the consensus.


-- 

:  David LeeI.T. Service  :
:  Senior Systems ProgrammerComputer Centre   :
:   Durham University :
:  http://www.dur.ac.uk/t.d.lee/South Road:
:   Durham DH1 3LE:
:  Phone: +44 191 334 2752  U.K.  :
___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


Re: [Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: tools by zhenh from

2006-04-18 Thread Andrew Beekhof


On Apr 18, 2006, at 1:09 PM, David Lee wrote:


On Tue, 18 Apr 2006, Andrew Beekhof wrote:


On Apr 18, 2006, at 12:08 PM, David Lee wrote:


On Wed, 12 Apr 2006, Andrew Beekhof wrote:


  [...]

config_file = /etc/ha.d/ha.cf
+   target_file = /var/lib/heartbeat/crm/cib.xml
+   to_stdout = False

[...]


Absolute path-names?  Doesn't feel right.  (We're in a .in file,
so we
should be able to abstract these into @...@ things.)


ah, you're right.  not so perfect :-(


So: you, or me, or A.N. Other (zhenh?) to fix?

I'd be happiest if it wasn't me.  (And I'm still officially on  
holiday!)

But I'm willing to do it if that's the consensus.



well its zhenh's file... so i vote him :)

--
Andrew Beekhof

Eating fruit is mean and vicious... keep your hands off Golden  
Delicious - TISM


___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


[Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: tools by zhenh from

2006-04-12 Thread Andrew Beekhof
On 4/12/06, linux-ha-cvs@lists.linux-ha.org
linux-ha-cvs@lists.linux-ha.org wrote:
 linux-ha CVS committal

 Author  : zhenh
 Host:
 Project : linux-ha
 Module  : tools

 Dir : linux-ha/tools


 Modified Files:
 haresources2cib.py.in


 Log Message:
 generate the cib in the final place with right permission

perfect

 ===
 RCS file: /home/cvs/linux-ha/linux-ha/tools/haresources2cib.py.in,v
 retrieving revision 1.9
 retrieving revision 1.10
 diff -u -3 -r1.9 -r1.10
 --- haresources2cib.py.in   12 Apr 2006 05:55:33 -  1.9
 +++ haresources2cib.py.in   12 Apr 2006 08:58:24 -  1.10
 @@ -338,6 +338,8 @@
  if __name__==__main__ :
 resource_file = /etc/ha.d/haresources
 config_file = /etc/ha.d/ha.cf
 +   target_file = /var/lib/heartbeat/crm/cib.xml
 +   to_stdout = False

 # Process arguments...
 skipthis = None
 @@ -348,6 +350,8 @@
 continue
 elif args[i] == --no-ocf :
 using_ocf = 0
 +   elif args[i] == --stdout :
 +   to_stdout = True
 elif args[i] == --no-monitor :
 using_mon = 0
 elif args[i] == --config or args[i] == -c :
 @@ -356,6 +360,7 @@
 elif args[i] == --help or args[i] == -h :
 print usage:  + sys.argv[0]  \
 +   [--no-ocf]\
 +   +   [--stdout]\
 +   [--no-monitor]\
 +   [--config|-c configfile]\
 +   [--help|-h]\
 @@ -404,9 +409,13 @@
 for stonith_host in stonith_host_list :
 add_stonith_host(cib, stonith_host, id_index, 
 node_num)
 id_index += 1
 -
 -   print cib[0].toprettyxml()
 -   sys.stderr.write(Notice:\n)
 -   sys.stderr.write(Please move the cib.xml generated to 
 /var/lib/heartbeat/crm/.\n)
 -   sys.stderr.write(It must be owned and read/writeable by user @[EMAIL 
 PROTECTED])
 -   sys.stderr.write(Or owned and read/writable by group @[EMAIL 
 PROTECTED])
 +   if to_stdout :
 +   print cib[0].toprettyxml()
 +   elif os.access(target_file, os.F_OK) or os.access(target_file+.sig, 
 os.F_OK) :
 +   sys.stderr.write(cib.xml or cib.xml.sig exist in 
 /var/lib/heartbeat/crm/\n)
 +   sys.stderr.write(please remove them before generating new 
 cib.xml\n)
 +   else :
 +   cib_file = open(target_file, w)
 +   cib_file.write(cib[0].toprettyxml())
 +   cib_file.close()
 +   os.system(chown  @[EMAIL PROTECTED]@HA_APIGROUP@ 
 +target_file)


 ___
 Linux-ha-cvs mailing list
 Linux-ha-cvs@lists.linux-ha.org
 http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs

___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/