Mailinglist Archive: opensuse-autoinstall (23 mails)

< Previous Next >
[opensuse-autoinstall] rules in rules.xml not and-ing
  • From: Mike Marion <mmarion@xxxxxxxxxxxx>
  • Date: Thu, 24 Apr 2008 14:19:54 -0700
  • Message-id: <20080424211951.GH29166@xxxxxxxxxxxxxxxxxxxx>
I just ran into my first case where I had a situation that seems to be
triggering a bug. I have several rules to get partition layout files
based on the disk(s) seen, and have a case where a vendor replaced a
drive and put it on the 2nd ata channel so it's hdc vs hda. This
shouldn't technically matter and it should come through as a single
disk, however the following rule:
<rule>
<disksize>
<match>/dev/hda 10000</match>
<match_type>greater</match_type>
</disksize>
<disksize>
<match>/dev/hdc 10000</match>
<match_type>greater</match_type>
</disksize>
<result>
<profile>@custom1@xxxxxxxxxxx</profile>
<continue config:type="boolean">false</continue>
</result>
<operator>and</operator>
</rule>

Is matching purely based on the size/existence of hdc. I just added
the operator tag to see if it helped even though it's supposed to
default to that. y2log shows:
2007-05-21 15:05:40 <1> 10.222.149.124(3424) [YCP] AutoInstallRules.ycp:390
Bash return: if ( [ "$disksize_size0" -gt "10000" -a "$disksize_device0" =
"/dev/hdc" ] ) ; then exit 0; else exit 1; fi ($["exit":0, "stderr":"",
"stdout":""]) ($["custom1":"compute", "disksize_device0":"/dev/hdc",
"disksize_size0":38166, "memsize":4032])

(note: yeah the clock is way off at this point)

I never even see it looking at hda... in either the above test or an
identical one that looks for both hda and hdb.

If I do have a host with both hda and hdc, it works as I would expect.
Or at least it always did, but I haven't done one of those in ages so
I'm not entirely sure the rules looked at both or just compared hdc like
above and it just worked since the resulting partition file was valid
for the disks in the host.

I realize now that it's completely throwing away the first <disksize> in
each rule... apparently you can't do the same type of attribute in the
same rule? Does someone have an example of checking more then 1
disksize in the same rule? I don't see this in the autoyast docs. I
freely admit I might just be missing it though.

I guess I've been lucky that the rules have been working like this thus
far.

--
Mike Marion-Unix SysAdmin/Staff IT Engineer-http://www.qualcomm.com
The Matrix is going down for reboot now!
Stopping reality: ....OK
The system is halted. -- yet another sig stolen from /.
--
To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-autoinstall+help@xxxxxxxxxxxx

< Previous Next >
This Thread
Follow Ups