Merge "Change sync db order and add retries for cinder client"
diff --git a/_modules/cinderng.py b/_modules/cinderng.py
index a5c7d42..71d7c5c 100644
--- a/_modules/cinderng.py
+++ b/_modules/cinderng.py
@@ -39,7 +39,8 @@
),
'endpoint_type': profile['endpoint_type'],
'certificate': profile['certificate'],
- 'region_name': profile['region_name']
+ 'region_name': profile['region_name'],
+ 'retries': profile.get('retries', 5)
}
return credentials
@@ -56,7 +57,8 @@
auth_url=cred['auth_url'],
endpoint_type=cred['endpoint_type'],
cacert=cred['certificate'],
- region_name=cred['region_name']
+ region_name=cred['region_name'],
+ retries=cred['retries']
)
return nt
diff --git a/cinder/controller.sls b/cinder/controller.sls
index 9d9c83b..e61b2ab 100644
--- a/cinder/controller.sls
+++ b/cinder/controller.sls
@@ -137,6 +137,17 @@
{%- endfor %}
+cinder_syncdb:
+ cmd.run:
+ - name: 'cinder-manage db sync; sleep 5;'
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
+ - require:
+ - pkg: cinder_controller_packages
+ - require_in:
+ - service: cinder_controller_services
+
{%- if controller.version in ('ocata','pike') %}
/etc/apache2/conf-available/cinder-wsgi.conf:
@@ -157,6 +168,8 @@
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
+ - require:
+ - pkg: cinder_controller_packages
- watch:
{%- if controller.message_queue.get('ssl',{}).get('enabled', False) %}
- file: rabbitmq_ca_cinder_controller
@@ -177,6 +190,8 @@
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
+ - require:
+ - pkg: cinder_controller_packages
- watch:
{%- if controller.message_queue.get('ssl',{}).get('enabled', False) %}
- file: rabbitmq_ca_cinder_controller
@@ -208,6 +223,8 @@
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
+ - require:
+ - pkg: cinder_controller_packages
- watch:
{%- if controller.message_queue.get('ssl',{}).get('enabled', False) %}
- file: rabbitmq_ca_cinder_controller
@@ -218,15 +235,6 @@
- file: /etc/cinder/cinder.conf
- file: /etc/cinder/api-paste.ini
-cinder_syncdb:
- cmd.run:
- - name: 'cinder-manage db sync; sleep 5;'
- {%- if grains.get('noservices') %}
- - onlyif: /bin/false
- {%- endif %}
- - require:
- - service: cinder_controller_services
-
{%- if not grains.get('noservices', False) %}
{%- set identity = controller.identity %}