Closed
Bug 1223128
Opened 9 years ago
Closed 9 years ago
[PulseGuardian] dbinit.py --dummy is broken
Categories
(Webtools :: Pulse, defect, P2)
Webtools
Pulse
Tracking
(firefox45 affected)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox45 | --- | affected |
People
(Reporter: mcote, Assigned: mikeyao2)
Details
Attachments
(2 files)
1.82 KB,
patch
|
Details | Diff | Splinter Review | |
2.07 KB,
patch
|
Details | Diff | Splinter Review |
It seems that running dbinit.py with the --dummy option is broken:
$ python pulseguardian/dbinit.py --dummy
INFO:__main__:Finished initializing database.
Traceback (most recent call last):
File "pulseguardian/dbinit.py", line 87, in <module>
dummy_data()
File "pulseguardian/dbinit.py", line 56, in dummy_data
password='dummy', management_api=pulse_management)
TypeError: new_user() got an unexpected keyword argument 'username'
This is almost certainly from the model changes I did a little while ago.
This function isn't used very often, but it should still be fixed.
(In reply to Mark Côté [:mcote] from comment #0)
> It seems that running dbinit.py with the --dummy option is broken:
>
> $ python pulseguardian/dbinit.py --dummy
> INFO:__main__:Finished initializing database.
> Traceback (most recent call last):
> File "pulseguardian/dbinit.py", line 87, in <module>
> dummy_data()
> File "pulseguardian/dbinit.py", line 56, in dummy_data
> password='dummy', management_api=pulse_management)
> TypeError: new_user() got an unexpected keyword argument 'username'
>
> This is almost certainly from the model changes I did a little while ago.
>
> This function isn't used very often, but it should still be fixed.
Hi Mark,
Please send the ticket to me.
Thanks
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → mikeyao2
Status: NEW → ASSIGNED
Reporter | ||
Comment 3•9 years ago
|
||
Hi, I get an error with this patch:
DETAIL: Key (owner_id)=(1) is not present in table "pulse_users".
This is because there is no PulseUser object. Before the models changed, there was a single User object that also acted as a PulseUser. We split PulseUser out because that way a single User (which represents a human user by a unique email address) could own multiple PulseUsers (which represent accounts in RabbitMQ).
The simplest fix here is to create a single User object and then four PulseUser objects, and use the PulseUser object IDs when you create the Queues.
Improved first patch but the "init_and_clear_db" need to change for deleting both of user and pulse_user. So just upload another patch and finish all then do the pull request on github.
Checked "init_and_clear_db" function, it seems re-created new database, no data remain. So don't need to think about how delete users. The patch was done, pull request created.
(In reply to Mike Yao from comment #4)
> Created attachment 8687684 [details] [diff] [review]
> dbinit-1223128-2.patch
>
> Improved first patch but the "init_and_clear_db" need to change for deleting
> both of user and pulse_user. So just upload another patch and finish all
> then do the pull request on github.
Reporter | ||
Comment 6•9 years ago
|
||
Great! There were just a couple tiny issues, which I fixed myself before merging your commit it. Also, in the future, our commit messages are normally "Bug <bug id>: <summary> r=<reviewer>". I rewrote yours before merging, so you can see an example.
Thanks for the patch! We'll find you something else now. :)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•