How to Solve NameError: name 'api' is not defined -- nova

Solution: Import the 'api' module

# Add the following line to the top of your code
from nova.conf import api

 

For more information:
nova api