[opensuse-autoinstall] rules in rules.xml not and-ing
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@_dideac.xml</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@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Thursday 24 April 2008, Mike Marion wrote:
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
<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>
that can not work. The second <disksize> will overwrite the first one. You can not use two times the same rule-tag like two times <disksize> or two times <memsize> and so on. It's not really a bug - maybe a design bug.
I never even see it looking at hda...
it even takes only the 10000 from the second <disksize> not just the device.
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?
Oh. Here you found that out on yourself :) Yes, exactly. -- ciao, Uwe Gansert Uwe Gansert, Server Technologies Team SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug listening to: Falling by mind.in.a.box -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (2)
-
Mike Marion
-
Uwe Gansert