In the example above, expire is empty, which means that the account has no expiration. By default, the SectionWithAttributes class converts the empty values to nil, so there is no way to distinguish when a properly was set as blank or it was missing in the profile. Such a differentiation is important in some cases like the expire option, because in case of blank, an empty string should be written in the /etc/shadow file for the Expiration Date field in order to make the account to never expire. And in case of nil (missing in the profile), nothing should be explicitly written in the file, giving the default value set by commands like useradd.
Solution
Now on, the attributes definition in SectionWithAttributes allows to indicate for each attribute whether blank values are allowed or not.
Coverage increased (+0.02%) to 40.939% when pulling 81f2958fa78d0a69655b84cf01a8eb4e4cd429d5 on joseivanlopez:autoyast-allow-blank into 62965843ad892c0c49f2ff4e1aeca8d81a5cacea on yast:master.
Problem
Sometimes, an AutoYaST profile might contain blank values for some properties, for example:
In the example above, expire is empty, which means that the account has no expiration. By default, the SectionWithAttributes class converts the empty values to nil, so there is no way to distinguish when a properly was set as blank or it was missing in the profile. Such a differentiation is important in some cases like the expire option, because in case of blank, an empty string should be written in the /etc/shadow file for the Expiration Date field in order to make the account to never expire. And in case of nil (missing in the profile), nothing should be explicitly written in the file, giving the default value set by commands like useradd.
Solution
Now on, the attributes definition in SectionWithAttributes allows to indicate for each attribute whether blank values are allowed or not.