Exemplo n.º 1
0
 def _get_all_cloudpipes(self, context):
     """Get all cloudpipes."""
     instances = self.compute_api.get_all(context,
                                          search_opts={'deleted': False},
                                          want_objects=True)
     return [instance for instance in instances
             if pipelib.is_vpn_image(instance.image_ref)
             and instance.vm_state != vm_states.DELETED]
Exemplo n.º 2
0
 def get_base_filter_list(self, instance, allow_dhcp):
     """Obtain a list of base filters to apply to an instance.
     The return value should be a list of strings, each
     specifying a filter name.  Subclasses can override this
     function to add additional filters as needed.  Additional
     filters added to the list must also be correctly defined
     within the subclass.
     """
     if pipelib.is_vpn_image(instance.image_ref):
         base_filter = 'patron-vpn'
     elif allow_dhcp:
         base_filter = 'patron-base'
     else:
         base_filter = 'patron-nodhcp'
     return [base_filter]