Conversation
Note: I'm still waiting for my new testbed to be ready to verify the fix. |
LGTM pending usual stuff: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (contingent)
@shaominchen Please rebase your branch with master to get .drone.sec changes. |
a28f76b
to
d02d00f
Compare
|
||
try: | ||
self.conn = sqlite3.connect(self.db_path) | ||
except sqlite3.Error as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can log the content of object e as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will log the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (CI pass)
Log the content of exception (only if it is helpful)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed changes looks good to me.
Can you please paste the error message (by executing the step mentioned the issue #1144) for the reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for pasting the sample output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Not this PR; but I feel all the errors reported to user/admin shouldn't be marked as "internal error". They should be clear as to what error or type of error is. |
sqlite3.connect() function will throw an exception instead of returning none if running into any errors. So we should try/catch the error instead of checking for none result.
Fix #1144
Test result:
Error from step 3:
[root@sc-rdops-vm09-dhcp-28-64:/var/log/vmware] vmdkops_admin vmgroup ls
Internal Error(DB connection error at /etc/vmware/vmdkops/auth-db)
Error from vmdk_ops.log:
05/03/17 00:15:41 91741 [MainThread] [ERROR ] Failed to connect to DB (/etc/vmware/vmdkops/auth-db): unable to open database file