Fix quota updating when admin deletes common user's instance

Add 'project_id=None' optional argument in QUOTAS related methods.

There are two problems when admin deletes instances of common user
before fixing this bug:
Firstly, It will get tenant quotas using context.project_id which
results in getting admin's quotas not common user's.
Secondly, It will also get wrong quota usages using context.project_id
when updating common user's quota_usages.

So we could pass into QUOTAS related methods an optional argument to
specify the tenant ID to be affected. And if it's not set, then we
default to drawing the tenant ID from the context.

Fixes: bug 1078668
Change-Id: I59bc240d6547122d803a3ed3e1eeef26fc78f4f0
Fix error in NovaBase.save() method

There is a bug in sqlalchemy with eventlet that doesn't allows us to use
session.flush() without explicit transaction.
If somethings went wrong in DB and rollback is called it will try to
raise NoneType.

I found only one way to handle this situation.
We should start transaction (or subtransaction if it already exists in session)
explicitly.

Fixes bug 1098692

Change-Id: I12cd643500e341a013cd7c963cb5d1a0106c7940
Handle directory conflicts with html output.

When calling html_report() if the output path already exists
instead of rewriting the files in the directory html_report
throws OSError: [Errno 17] File exists which leads to a 500
return to the api call. This commit avoids this issue by
checking if the directory exists beforehand and returning a
400 with an error message instead.

Change-Id: I061534c9ce9977692a7fc98187c4797b2ed60ab2
Merge "Handle directory conflicts with html output."
Merge "Fix quota updating when admin deletes common user's instance"
Merge "Fix error in NovaBase.save() method"