I believe the OSError and KeyError are only thrown by the _norm_uid and 
_norm_gid functions which aren't called in the code paths which don't 
specify scopename. I'm happy to move those lines to make it a little 
clearer that this is OK though if you prefer.

On 04/02/14 15:42, Chris St. Pierre wrote:
> In src/lib/Bcfg2/Client/Tools/POSIX/base.py:
>
>>                  elif scope == posix1e.ACL_GROUP:
>> -                    scopename = "group"
>> -                    aclentry.qualifier = self._norm_gid(qualifier)
>> +                    if qualifier:
>> +                        scopename = "group"
>> +                        aclentry.qualifier = self._norm_gid(qualifier)
>> +                    else:
>> +                        aclentry.tag_type = posix1e.ACL_GROUP_OBJ
>>              except (OSError, KeyError):
>>                  err = sys.exc_info()[1]
>>                  self.logger.error("POSIX: Could not resolve %s %s: %s" %
>
> If there's no qualifier and there is an OSError or KeyError, this error
> message will barf because "scopename" is not set. Do the if blocks above
> need to be restructured as something like:
>
> |scopename = "group"
> if qualifier:
>      aclentry.qualifier = self._norm_gid(qualifier)
> else:
>      aclentry.tag_type = posix1e.ACL_GROUP_OBJ
> |
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Bcfg2/bcfg2/pull/156/files#r9424668>.
>