~openstack-charmers-next/charms/precise/nova-compute/trunk

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/context.py

  • Committer: Edward Hope-Morley
  • Date: 2016-04-01 11:17:38 UTC
  • Revision ID: edward.hope-morley@canonical.com-20160401111738-rdrvjreaib9wy273
Support using internal network for clients

Openstack mostly defaults to using public endpoints for
internal communication between services. This patch adds
a new option use-internal-endpoints which, if set to True,
will configure services to use internal endpoints where
possible.

Closes-Bug: 1456876
Change-Id: I736a0a281ec434067bc92fa70898b16a027f7422

Show diffs side-by-side

added added

removed removed

Lines of Context:
1479
1479
                if self.context_complete(ctxt):
1480
1480
                    return ctxt
1481
1481
        return {}
 
1482
 
 
1483
 
 
1484
class InternalEndpointContext(OSContextGenerator):
 
1485
    """Internal endpoint context.
 
1486
 
 
1487
    This context provides the endpoint type used for communication between
 
1488
    services e.g. between Nova and Cinder internally. Openstack uses Public
 
1489
    endpoints by default so this allows admins to optionally use internal
 
1490
    endpoints.
 
1491
    """
 
1492
    def __call__(self):
 
1493
        return {'use_internal_endpoints': config('use-internal-endpoints')}