CCI-MOC / moc-openstack-tools

Tools for OpenStack administration, user/project management, etc.
Apache License 2.0
0 stars 8 forks source link

Remove set-quota requests from Google Sheets #88

Closed leotomatsu closed 7 years ago

leotomatsu commented 7 years ago

Currently here's a bug on Google Sheets where processed rows are not deleted automatically.

leotomatsu commented 7 years ago

Not sure exactly why yet, but this line of code is not being run code

pjd-nu commented 7 years ago

First suspicion is that you're getting an exception on the line before

xuhang57 commented 7 years ago

guess you can drop a python debugger and see whether it is called?

kamfonik commented 7 years ago

Some thoughts: 1) If you got an error from msg.send() in line 256, that can also cause copy_index to be empty and the whole if statement gets skipped. Are the rows being appended to Processed Rows? 2) It won't delete the last non-frozen line, so if there's not a blank line at the bottom of the spreadsheet, deletion will fail (although this should result in an error from Google Sheets).

greyspectrum commented 7 years ago

I think this is related to #92. The Google API doesn't seem to be granting write access. I'm not yet sure why that would be, since the mocwebsite .json auth file hasn't changed.

pjd-nu commented 7 years ago

Does the auth token need to be regenerated? There were some changes to passwords and authorization recently.

On Oct 17, 2017, at 9:22 PM, kamfonik notifications@github.com wrote:

Some thoughts:

If you got an error from msg.send() in line 256, that can also cause copy_index to be empty and the whole if statement gets skipped. Are the rows being appended to Processed Rows? It won't delete the last non-frozen line, so if there's not a blank line at the bottom of the spreadsheet, deletion will fail (although this should result in an error from Google Sheets). — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CCI-MOC/moc-openstack-tools/issues/88#issuecomment-337432584, or mute the thread https://github.com/notifications/unsubscribe-auth/ADuOqxAH-AmiZ1Z0Lp3p74V72aWpocYnks5stVK7gaJpZM4P8bhh.

greyspectrum commented 7 years ago

@pjd-nu I'm not sure. I wasn't aware of any changes. I can ping you via email.

greyspectrum commented 7 years ago

This is a bit of a non-sequitur, but did anyone with access to the helpdesk-vm make local changes, outside of version control? I noticed that the local is ahead of the remote today, but it was synced when I left it last. Edit: Fixed now.

greyspectrum commented 7 years ago

I just checked the Google Cloud Platform API settings for the moc account. The API key there matches the one on the helpdesk-vm; it's still valid.

kamfonik commented 7 years ago

@greyspectrum the problem with this and #92 is that the service account is only granted read access to the spreadsheet. It needs to be granted write access.

greyspectrum commented 7 years ago

@kamfonik Yup, you're right. The service account only had read access on both the account requests spreadsheet and the quota requests spreadsheet. This would also explain why addusers.py was running successfully from the crontab until recently, but then stopped doing so. Thanks for pointing that out. I've changed it back now, so the service account has write access. I'm going to run some tests now to confirm that it's working.

Does anyone know who changed those permissions? That totally broke the helpdesk-vm.

greyspectrum commented 7 years ago

I've confirmed that set-quotas.py now runs successfully, from cron. My test quota request to up my instances from 10 to 20 went through successfully. I am now closing this issue.