modify etc_group to return complete group info

This commit is contained in:
Christoph Hartmann 2015-10-07 11:28:00 +02:00
parent 537728b41b
commit 9fb51b44a2

View file

@ -103,6 +103,13 @@ class EtcGroup < Vulcano.resource(1)
} }
line, _idx_nl = parse_comment_line(line, opts) line, _idx_nl = parse_comment_line(line, opts)
line.split(':') line.split(':')
# x = line.split(':')
# {
# 'name' => x.at(0), # Name of the group.
# 'password' => x.at(1), # Group's encrypted password.
# 'gid' => convert_to_i(x.at(2)), # The group's decimal ID.
# 'members' => x.at(3), # Group members.
# }
end end
end end
@ -113,14 +120,22 @@ class EtcGroupView
@filter = filter @filter = filter
end end
# returns the group object
def groups def groups
@filter
end
# only returns group name
def group_names
@parent.groups(@filter) @parent.groups(@filter)
end end
# only return gids
def gids def gids
@parent.gids(@filter) @parent.gids(@filter)
end end
# only returns users
def users def users
@parent.users(@filter) @parent.users(@filter)
end end