Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Changed Neutron_api after Aniket review
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-verma committed Jun 12, 2015
1 parent 1f3fc66 commit e9c8fe6
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions hooks/neutron_api_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,40 @@ def conditional_neutron_migration():
if allowed_units and local_unit() in allowed_units.split():
if (os_release('neutron-server') == 'juno' and
config('neutron-plugin') == 'vsp'):
log('Nuage VSP with Juno Relase')
nuage_migration_db_path = '/usr/lib/python2.7/dist-packages/'\
'neutron/db/migration/nuage'
nuage_migrate_hybrid_file_path = os.path.join(
nuage_migration_db_path, 'migrate_hybrid_juno.py')
nuage_plugin_path = '/etc/neutron/plugins/nuage/'\
'nuage_plugin.ini'
if os.path.exists(nuage_migration_db_path):
log('Running Migartion_Script_for_Juno_Release')
check_output(
[
'bash', '-c',
'cd {}; sudo python migrate_hybrid_juno.py'
' --config-file'
' /etc/neutron/plugins/nuage/nuage_plugin.ini'
' --config-file /etc/neutron/neutron.conf'.format(
nuage_migration_db_path)
]
)
if os.path.exists(nuage_migrate_hybrid_file_path):
if os.path.exists(nuage_plugin_path):
log('Running Migartion_Script_for_Juno_Release')
check_output(
[
'bash', '-c',
'cd {}; sudo python migrate_hybrid_juno.py'
' --config-file'
' /etc/neutron/plugins/nuage/'
'nuage_plugin.ini --config-file '
'/etc/neutron/neutron.conf'.format(
nuage_migration_db_path)
]
)
else:
e = nuage_plugin_path+' doesnot exist'
log(e, level=ERROR)
raise Exception(e)
else:
e = nuage_migrate_hybrid_file_path+' doesnot exists'
log(e, level=ERROR)
raise Exception(e)
else:
log('Path doesnot exists{}'.format(
nuage_migration_db_path))
log('Therefore cannot run Neutron db Migration Script')

e = nuage_migration_db_path+' doesnot exists'
log(e, level=ERROR)
raise Exception(e)
else:
migrate_neutron_database()
service_restart('neutron-server')
Expand Down

0 comments on commit e9c8fe6

Please sign in to comment.