From 36a9703a192af16d2bad8cc7fec1eba25de8d01b Mon Sep 17 00:00:00 2001
From: Steve Martinelli <stevemar@ca.ibm.com>
Date: Thu, 13 Aug 2015 21:57:53 -0700
Subject: [PATCH] Support listing users by group name

Listing users within a group is not presently domain scoped. We
do not use the domain info at all when the group option is present.
A new --group-domain option is not needed since we cannot list
users by --project and --group, they are mutually exclusive (as
per the identity API).

Closes-Bug: 1492916
Change-Id: I50f995ee4a03c2bdb21f2b5722546ab8fe786eb6
---
 openstackclient/identity/v3/user.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py
index 459707d2af..737ebc652a 100644
--- a/openstackclient/identity/v3/user.py
+++ b/openstackclient/identity/v3/user.py
@@ -214,13 +214,11 @@ class ListUser(lister.Lister):
             domain = common.find_domain(identity_client,
                                         parsed_args.domain).id
 
+        group = None
         if parsed_args.group:
-            group = utils.find_resource(
-                identity_client.groups,
-                parsed_args.group,
-            ).id
-        else:
-            group = None
+            group = common.find_group(identity_client,
+                                      parsed_args.group,
+                                      parsed_args.domain).id
 
         if parsed_args.project:
             if domain is not None: