Révision 33cff547
Add autoconf and enhance graphs
| plugins/nova/nova_instance_launched | ||
|---|---|---|
| 12 | 12 |
# |
| 13 | 13 |
# Magic markers |
| 14 | 14 |
#%# capabilities=autoconf |
| 15 |
#%# family=nova
|
|
| 15 |
#%# family=auto
|
|
| 16 | 16 |
|
| 17 |
from nova import context |
|
| 18 |
from nova import db |
|
| 19 |
from nova import flags |
|
| 20 |
from nova import utils |
|
| 21 |
from nova.db.sqlalchemy.session import get_session |
|
| 22 | 17 |
import sys |
| 23 | 18 |
|
| 19 |
try: |
|
| 20 |
from nova import context |
|
| 21 |
from nova import db |
|
| 22 |
from nova import flags |
|
| 23 |
from nova import utils |
|
| 24 |
from nova.db.sqlalchemy.session import get_session |
|
| 25 |
except ImportError: |
|
| 26 |
succesful_import = False |
|
| 27 |
else: |
|
| 28 |
succesful_import = True |
|
| 29 |
|
|
| 24 | 30 |
def print_config(): |
| 25 | 31 |
global states |
| 26 | 32 |
print 'graph_title Nova Instances Launched' |
| ... | ... | |
| 46 | 52 |
if sys.argv[1] == "config": |
| 47 | 53 |
print_config() |
| 48 | 54 |
elif sys.argv[1]=="autoconf" : |
| 49 |
print "yes" |
|
| 50 |
else: |
|
| 55 |
if not succesful_import: |
|
| 56 |
print 'no (failed import nova module)' |
|
| 57 |
sys.exit(0) |
|
| 58 |
else: |
|
| 59 |
print 'yes' |
|
| 60 |
elif succesful_import: |
|
| 51 | 61 |
utils.default_flagfile() |
| 52 | 62 |
flags.FLAGS(sys.argv) |
| 53 | 63 |
print_values() |
Formats disponibles : Unified diff