Bug 1126155
Summary: | hammer import organization summary shows count of users instead of organizations | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Lukas Pramuk <lpramuk> |
Component: | Transitions | Assignee: | Matej Kollar <mkollar> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Grant Gainey <ggainey> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | Unspecified | CC: | bbuckingham, cperry, ggainey, jmontleo, mkollar, sthirugn, tkolhar |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-09-11 12:27:05 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1125243 |
Description
Lukas Pramuk
2014-08-02 20:00:55 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. And hammer import user summary shows no count. I would expect there: " Found 281 users." # hammer import user --csv-file /tmp/exports/users.csv --new-passwords $(mktemp -u) Summary Seemingly wrong numbers are caused by the fact that we reuse same CSV for organization and users, so organization is repeated multiple times. One possibility is to check whether entity (organization) is created before attempting to create it in subcommand subclass. This might lead to code duplication though. Will discuss this with other team members before I proceed. hammer-cli-import.git: 46067a049eb8a63f879aab5d44a7c76324af3f2e Through discussion we decided to proceed the following way: Instead of changing messages or changes proposed in comment #4, show :found messages only on info log level. One more related patch, just a stylistic one though hammer-cli-import.git: 6b2bc5c5c9183b048fafc0c317b5dffcde47bce1 FAILEDQA: # hammer import organization --csv-file test1.csv [Foreman] username: admin [Foreman] password for admin: Error: FasterCSV::MalformedCSVError # cat test1.csv "organization_id"=>5, "organization"=> jhutar Your test1.csv doesn't look anything like the output of "spacewalk-report users" - the tool is telling you exactly what it should. Returning to ON_QA VERIFIED installed spacewalk-report tool and tested # hammer import organization --csv-file test1.csv [Foreman] username: admin [Foreman] password for admin: Summary Found 11 organizations. shifting this to ON_QA as discussed in the email will be handled by @ggainey DEVELOPER-VERIFIED: === ~/tests $ hammer import organization --csv-file /root/tests/1126155.csv Summary Created 2 organizations. ~/tests $ hammer import user --csv-file /root/tests/1126155.csv --new-passwords pwds.txt Summary Created 7 users. ~/tests $ cat 1126155.csv organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active 1000,KiloCompany,1001,kc-admin,Nimda,Admin,,root@localhost,Organization Administrator;Satellite Administrator,2014-03-24 23:47:57,2014-08-27 22:12:07,enabled 1000,Kilo Company,1008,kc-channel-admin,Admin,Channel,admin,root@localhost,Channel Administrator,2014-05-05 19:43:38,,enabled 1000,Kilo Company,1012,kc-anewlogin,NewLastName,NewFirst,,anewlogin.email,,2014-07-31 18:46:37,,enabled 1000,Kilo Company,1013,kc-anewlogin1,NewLastName,NewFirst,,anewlogin1.email,,2014-07-31 18:47:11,,enabled 1000,Kilo Company,1014,kc-anewlogin2,NewLastName,NewFirst,,anewlogin2.email,,2014-07-31 18:47:40,,enabled 7000,Septimus,7009,sept-admin-1,Admin,SOE,,root@localhost,Organization Administrator,2014-05-06 00:55:02,2014-08-27 19:07:46,enabled 7000,Septimus,7011,sept-app-admin-1,Admin,App,,root@localhost,,2014-05-07 20:14:39,,enabled === As noted in c#5, in the log we notice every line: === I, [2014-09-04T11:22:02.356647 #15344] INFO -- : Importing from /root/tests/1126155.csv I, [2014-09-04T11:22:02.358207 #15344] INFO -- : Creating new organization: KiloCompany I, [2014-09-04T11:22:07.349130 #15344] INFO -- : Organization [1000->5] already imported. I, [2014-09-04T11:22:07.349564 #15344] INFO -- : Organization [1000->5] already imported. I, [2014-09-04T11:22:07.349911 #15344] INFO -- : Organization [1000->5] already imported. I, [2014-09-04T11:22:07.350246 #15344] INFO -- : Organization [1000->5] already imported. I, [2014-09-04T11:22:07.350597 #15344] INFO -- : Creating new organization: Septimus I, [2014-09-04T11:22:09.738496 #15344] INFO -- : Organization [7000->6] already imported. I, [2014-09-04T11:22:09.740440 #15344] INFO -- : Summary I, [2014-09-04T11:22:09.740709 #15344] INFO -- : Found 5 organizations. I, [2014-09-04T11:22:09.740950 #15344] INFO -- : Created 2 organizations. === Verified against 0.10.4 This was delivered with Satellite 6.0 which was released on 10 September 2014. |