Bug 1123337 - Should not print 'member|add' message to out-file if no team member need to sync from LDAP
Summary: Should not print 'member|add' message to out-file if no team member need to s...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: All
OS: All
medium
low
Target Milestone: ---
: ---
Assignee: Rory Thrasher
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-25 11:12 UTC by zhaozhanqi
Modified: 2017-05-31 18:22 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-31 18:22:11 UTC


Attachments (Terms of Use)

Description zhaozhanqi 2014-07-25 11:12:06 UTC
Description of problem:
Sync team members from LDAP, the out-file still also print one message like "MEMBER|ADD|openshift|" even if no members need to sync.

Version-Release number of selected component (if applicable):
devenv_5008

How reproducible:
always

Steps to Reproduce:
1. Setup LDAP server and add one group named 'openshift' which include one member "test@redhat.com"
2. Sync this group to openshift global team
  oo-broker oo-admin-ctl-team -c create --config-file /usr/local/config.yml --groups "openshift"
3. Add one member to this team by sync-from-file
  
  #cat /usr/local/user.txt <<EOF
   USER|ADD|test2@redhat.com
   MEMBER|ADD|all|test2@redhat.com
  EOF

  #oo-broker oo-admin-ctl-team -c sync-from-file --in-file /usr/local/user.txt

4. print the user which is in team but not in LDAP group to file remove.txt
   #oo-broker oo-admin-ctl-team -c sync-to-file --config-file /usr/local/config.yml --out-file /usr/local/remove.txt --remove-old-users
5. Check the remove.txt
Actual results:

step 5:
cat remove.txt
MEMBER|ADD|openshift|
MEMBER|REMOVE|openshift|test2@redhat.com

Expected results:

Should not print 'MEMBER|ADD|openshift|' since no member need to add.

Additional info:

Comment 1 openshift-github-bot 2016-01-05 23:05:12 UTC
Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/37a930d958c2fe08cc267567cb6523e256c58479
oo-admin-ctl-team: check to avoid output if no members

Bug 1123337
BZ https://bugzilla.redhat.com/show_bug.cgi?id=1123337

The oo-admin-ctl-team script was printing "MEMBER|ADD|groupname|" even if there
were no members being added.  This will now only output if there are members in
the members_to_add variable.

https://github.com/openshift/origin-server/commit/2c03c3e31c696bf9c5caf722f520837aff279434
Merge pull request #6343 from thrasher-redhat/bug1123337

Merged by openshift-bot

Comment 2 Rory Thrasher 2016-01-06 15:27:01 UTC
QA,

The oo-admin-ctl-team script should no longer be printing "MEMBER|ADD|teamname|" if there are no members being added.  Please verify that this is the case based on the original steps to reproduce.

1. Setup LDAP server and add one group named 'openshift' which include one member "test@redhat.com"

2. Sync this group to openshift global team
  oo-broker oo-admin-ctl-team -c create --config-file /usr/local/config.yml --groups "openshift"

3. Add one member to this team by sync-from-file
  
  #cat /usr/local/user.txt <<EOF
   USER|ADD|test2@redhat.com
   MEMBER|ADD|all|test2@redhat.com
  EOF

  #oo-broker oo-admin-ctl-team -c sync-from-file --in-file /usr/local/user.txt

4. print the user which is in team but not in LDAP group to file remove.txt
   #oo-broker oo-admin-ctl-team -c sync-to-file --config-file /usr/local/config.yml --out-file /usr/local/remove.txt --remove-old-users

5. Check the remove.txt to ensure there is no line that has "MEMBERS|ADD|openshift|" with no members listed.

Comment 3 zhaozhanqi 2016-01-07 03:30:57 UTC
Verified this bug on devenv_5764

[root@ip-172-18-7-156 local]# cat remove.txt 
MEMBER|REMOVE|first ten|test2@redhat.com

Comment 4 Eric Paris 2017-05-31 18:22:11 UTC
We apologize, however, we do not plan to address this report at this time. The majority of our active development is for the v3 version of OpenShift. If you would like for Red Hat to reconsider this decision, please reach out to your support representative. We are very sorry for any inconvenience this may cause.


Note You need to log in before you can comment on or make changes to this bug.