Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_group_model() doesn't handle undefined groups #5

Open
whitlockjc opened this issue Nov 15, 2015 · 0 comments
Open

create_group_model() doesn't handle undefined groups #5

whitlockjc opened this issue Nov 15, 2015 · 0 comments

Comments

@whitlockjc
Copy link
Owner

create_group_model contains a test for each member of each group, that checks whether the member is really another group. However, get_dict_key_from_value will return None if the member is a group, but that group is not in the dictionary. This can happen if you start your search at a point in the tree below where the group is defined. At this point, create_group_model tries to concatenate None to the string GROUP:, resulting in an exception.

This bit of code needs a trap for get_dict_key_from_value returning None:

key = get_dict_key_from_value(groupmap, mg[0][0][0])
if key == None:
  if verbose:
    print("[WARNING]: this member is a group, but the group is not in the group dictionary:" + mg[0][0][0])
else:
  members.append("GROUP:" + key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant