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

2006-04-19 Thread Alan Robertson

David Lee wrote:

On Tue, 18 Apr 2006, Alan Robertson wrote:


Andrew Beekhof wrote:

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


[...]
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 :)

And, he's on vacation for the next 3 weeks, so he can't defend himself :-(.

Can one of you please fix it?


OK.  I've got this in hand.  I hope to have the fix in CVS later this week
or early next.

Looking deeper, it seems that our current "configure" doesn't set the
directories he wants, so I presume he had inserted these directory names
as a shortcut.

My proposed fix is to define the directories via "configure" and make use
of the result.

Also, once this is done, we can take advantage of it in the "heartbeat"
subdirectory, where various things have to construct similar pathnames and
so could gain from inheriting them more directly from configure.


Sounds good to me.

--
Alan Robertson <[EMAIL PROTECTED]>

"Openness is the foundation and preservative of friendship...  Let me 
claim from you at all times your undisguised opinions." - William 
Wilberforce

___
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-19 Thread David Lee
On Tue, 18 Apr 2006, Alan Robertson wrote:

> Andrew Beekhof wrote:
> >
> > On Apr 18, 2006, at 1:09 PM, David Lee wrote:
> >
> >>> [...]
> >>> 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 :)
>
> And, he's on vacation for the next 3 weeks, so he can't defend himself :-(.
>
> Can one of you please fix it?

OK.  I've got this in hand.  I hope to have the fix in CVS later this week
or early next.

Looking deeper, it seems that our current "configure" doesn't set the
directories he wants, so I presume he had inserted these directory names
as a shortcut.

My proposed fix is to define the directories via "configure" and make use
of the result.

Also, once this is done, we can take advantage of it in the "heartbeat"
subdirectory, where various things have to construct similar pathnames and
so could gain from inheriting them more directly from configure.

Sound OK?

-- 

:  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 Alan Robertson

Andrew Beekhof wrote:


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 :)


And, he's on vacation for the next 3 weeks, so he can't defend himself :-(.

Can one of you please fix it?

--
Alan Robertson <[EMAIL PROTECTED]>

"Openness is the foundation and preservative of friendship...  Let me 
claim from you at all times your undisguised opinions." - William 
Wilberforce

___
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/


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 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
 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 Wed, 12 Apr 2006, Andrew Beekhof wrote:

> On 4/12/06, 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.)


> [...]
> > +   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/


[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
 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/


[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
 wrote:
> linux-ha CVS committal
>
> Author  : zhenh
> Host:
> Project : linux-ha
> Module  : tools
>
> Dir : linux-ha/tools
>
>
> Modified Files:
> haresources2cib.py.in
>
>
> Log Message:
> add reminder to user about the lcoation and permission of cib.xml

As a suggestion, how about we automatically put it in the right place
and give it the correct permissions?

If there is already an existing CIB, just complain and exit.

In the same way, if no config file is specified... use
/etc/ha.d/haresources (just as we automatically use /etc/ha.d/ha.cf)

> ===
> RCS file: /home/cvs/linux-ha/linux-ha/tools/haresources2cib.py.in,v
> retrieving revision 1.8
> retrieving revision 1.9
> diff -u -3 -r1.8 -r1.9
> --- haresources2cib.py.in   17 Mar 2006 18:01:07 -  1.8
> +++ haresources2cib.py.in   12 Apr 2006 05:55:33 -  1.9
> @@ -396,7 +396,7 @@
> group_index += 1
> id_index += len(fields)
> else :
> -   print "can not parse this line:"+line
> +   sys.stderr.write("can not parse this line:"+line+"\n")
> if enable_stonith :
> node_num = 0
> for nodes in node_list :
> @@ -406,3 +406,7 @@
> 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]")
>
>
> ___
> 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/