Merge "Do not add port in public URL if equals 80"
diff --git a/keystone/client/server.sls b/keystone/client/server.sls
index d66052e..ef78a5f 100644
--- a/keystone/client/server.sls
+++ b/keystone/client/server.sls
@@ -66,7 +66,7 @@
 keystone_{{ server_name }}_service_{{ service_name }}_endpoint_{{ endpoint.region }}:
   keystoneng.endpoint_present:
   - name: {{ service_name }}
-  - publicurl: '{{ endpoint.get('public_protocol', 'http') }}://{{ endpoint.public_address }}{% if not (endpoint.get('public_protocol', 'http') == 'https' and endpoint.public_port|int == 443) %}:{{ endpoint.public_port }}{% endif %}{{ endpoint.public_path }}'
+  - publicurl: '{{ endpoint.get('public_protocol', 'http') }}://{{ endpoint.public_address }}{% if not ((endpoint.get('public_protocol') == 'https' and endpoint.public_port|int == 443) or (endpoint.get('public_protocol') == 'http' and endpoint.public_port|int == 80)) %}:{{ endpoint.public_port }}{% endif %}{{ endpoint.public_path }}'
   - internalurl: '{{ endpoint.get('internal_protocol', 'http') }}://{{ endpoint.internal_address }}{% if not (endpoint.get('internal_protocol', 'http') == 'https' and endpoint.internal_port|int == 443) %}:{{ endpoint.internal_port }}{% endif %}{{ endpoint.internal_path }}'
   - adminurl: '{{ endpoint.get('admin_protocol', 'http') }}://{{ endpoint.admin_address }}{% if not (endpoint.get('admin_protocol', 'http') == 'https' and endpoint.admin_port|int == 443) %}:{{ endpoint.admin_port }}{% endif %}{{ endpoint.admin_path }}'
   - region: {{ endpoint.region }}
diff --git a/keystone/server.sls b/keystone/server.sls
index 27985ee..2c2bd9b 100644
--- a/keystone/server.sls
+++ b/keystone/server.sls
@@ -505,7 +505,7 @@
 keystone_{{ service_name }}_{{ service.get('region', 'RegionOne') }}_endpoint:
   keystoneng.endpoint_present:
   - name: {{ service.get('service', service_name) }}
-  - publicurl: '{{ service.bind.get('public_protocol', 'http') }}://{{ service.bind.public_address }}:{{ service.bind.public_port }}{{ service.bind.public_path }}'
+  - publicurl: '{{ service.bind.get('public_protocol', 'http') }}://{{ service.bind.public_address }}{% if not service.bind.public_port|int == 80 %}:{{ service.bind.public_port }}{% endif %}{{ service.bind.public_path }}'
   - internalurl: '{{ service.bind.get('internal_protocol', 'http') }}://{{ service.bind.internal_address }}:{{ service.bind.internal_port }}{{ service.bind.internal_path }}'
   - adminurl: '{{ service.bind.get('admin_protocol', 'http') }}://{{ service.bind.admin_address }}:{{ service.bind.admin_port }}{{ service.bind.admin_path }}'
   - region: {{ service.get('region', 'RegionOne') }}