Bug 246683
Summary: | Reimplement ds_create without setuputil code | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Rich Megginson <rmeggins> | ||||||||||||||||||||
Component: | Admin | Assignee: | Rich Megginson <rmeggins> | ||||||||||||||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||||||||||||||||||
Severity: | low | Docs Contact: | |||||||||||||||||||||
Priority: | low | ||||||||||||||||||||||
Version: | 1.1.0beta | CC: | nhosoi, nkinder | ||||||||||||||||||||
Target Milestone: | --- | ||||||||||||||||||||||
Target Release: | --- | ||||||||||||||||||||||
Hardware: | All | ||||||||||||||||||||||
OS: | Linux | ||||||||||||||||||||||
Whiteboard: | |||||||||||||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||||||||||||
Doc Text: | Story Points: | --- | |||||||||||||||||||||
Clone Of: | Environment: | ||||||||||||||||||||||
Last Closed: | 2015-12-07 16:52:31 UTC | Type: | --- | ||||||||||||||||||||
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: | 240316, 427409 | ||||||||||||||||||||||
Attachments: |
|
Description
Rich Megginson
2007-07-03 22:26:15 UTC
Created attachment 158484 [details]
new FileConn.pm
Created attachment 158485 [details]
ds diffs
Created attachment 158486 [details]
new ds_create.in
Created attachment 158487 [details]
adminserver diffs
Your implementation looks very cool. I can borrow a lot for ds_remove. BTW, I could not find ds_create.res in the attached files. Created attachment 158491 [details] cvs commit log (Comment #1 and Comment #2) Reviewed by: nhosoi (Thanks!) Fix Description: ds_create was a CGI program that would create a new instance, set it up to be managed by console, and register it with the config ds. The new ds_create CGI perl script does just that. One tricky part was that, rather than enabling the pass through auth plugin and having to restart the server, the new server is created without being started, then the modification is done to the new server dse.ldif file directly, using the new FileConn.pm module, which simulates a Mozilla::LDAP::Conn on an LDIF file. This also allows us to create a new instance with a pre-hashed rootdn password, rather than having to send the cleartext password. I had to move around some code in AdminServer and AdminUtil so that I could use it from ds_create. I also implemented support for the admin server PASSWORD_PIPE in perl so we could use it in other CGI perl scripts. Finally, the error handling was not consistent in our code, so I made explicit the passing of error messages up and down the stack. Oh how I wish we could just do this in python and use exception handling . . . I added a test for ds_create. Platforms tested: RHEL4 Flag Day: Yes - autotool changes Doc impact: No. Should work the same way as the old ds_create. Created attachment 158494 [details] cvs commit log (Comment #3 and Comment #4) Reviewed by: nhosoi (Thanks!) Fix Description: ds_create was a CGI program that would create a new instance, set it up to be managed by console, and register it with the config ds. The new ds_create CGI perl script does just that. One tricky part was that, rather than enabling the pass through auth plugin and having to restart the server, the new server is created without being started, then the modification is done to the new server dse.ldif file directly, using the new FileConn.pm module, which simulates a Mozilla::LDAP::Conn on an LDIF file. This also allows us to create a new instance with a pre-hashed rootdn password, rather than having to send the cleartext password. I had to move around some code in AdminServer and AdminUtil so that I could use it from ds_create. I also implemented support for the admin server PASSWORD_PIPE in perl so we could use it in other CGI perl scripts. Finally, the error handling was not consistent in our code, so I made explicit the passing of error messages up and down the stack. Oh how I wish we could just do this in python and use exception handling . . . I added a test for ds_create. Platforms tested: RHEL4 Flag Day: Yes - autotool changes Doc impact: No. Should work the same way as the old ds_create. (In reply to comment #6) > BTW, I could not find ds_create.res in the attached files. Sorry, I didn't attach it - it's currently empty - I just added it as a placeholder, in case we need to add something in the future. Created attachment 158914 [details]
cvs diff ds_create.in
File: adminserver/admserv/cgi-src40/ds_create.in
Description: Console expects to receive the CGI output starting from
"Content-type". Adding the line to the output, I could create new instances
from the Console!!
It's not really text/html, I guess it's just text/plain. Otherwise, ok. Oops. :p Thanks, Rich. I'm fixing ds_rewmove.in, too. (In reply to comment #12) > Oops. :p Thanks, Rich. I'm fixing ds_rewmove.in, too. Hmmm, an interesting observation... If I put "text/html", these 2 lines are displayed on the Status window: Creating new server instance... The operation was successful. If I put "text/plain", "The operation was successful" is not displayed even though it was successful... (In reply to comment #13) > (In reply to comment #12) > > Oops. :p Thanks, Rich. I'm fixing ds_rewmove.in, too. > > Hmmm, an interesting observation... If I put "text/html", these 2 lines are > displayed on the Status window: > > Creating new server instance... > The operation was successful. > > If I put "text/plain", "The operation was successful" is not displayed even > though it was successful... I guess the console expects text/html . . . Thank you to Nathan for the detailed investigation on the dialog issue. Nathan found out httpd requires "Content-type: text/plain\n\n" (note: 2 '\n's). Regarsing "text/plain" v.s. "text/html", it should have been my test problem. I cannot reproduce the problem any longer! So, I'm checking in ds_create.in and ds_remove.in calling 'print "Content-type: text/plain\n\n";' before each print out to STDOUT. I'm attaching the diffs next. Created attachment 158989 [details]
cvs diff ds_create.in ds_remove.in
Files: adminserver/admserv/cgi-src40/{ds_create.in ds_remove.in}
Description: calling 'print "Content-type: text/plain\n\n";' before each print
out to STDOUT.
Created attachment 159007 [details] cvs commit (comment #16) Thank you for your help, Rich and Nathan. Checked in the diffs into HEAD. Tested by console tests. Changed status to verified. |