Beispiel #1
0
    def update_billing_source(self, source_id, billing_source):
        """Store billing source update."""
        instance = storage.get_source(source_id, "Unable to PATCH", LOG.error)
        instance.billing_source = billing_source
        if instance.source_uuid:
            instance.pending_update = True

        instance.save()
        return True
Beispiel #2
0
    def update_authentication(self, source_id, authentication):
        """Store authentication update."""
        instance = storage.get_source(source_id, "Unable to PATCH", LOG.error)
        instance.authentication = authentication
        if instance.source_uuid:
            instance.pending_update = True

        instance.save()
        return True
Beispiel #3
0
 def test_get_source_db_down(self, mock_objects):
     """Tests creating a source db record with invalid auth_header."""
     mock_objects.get.side_effect = InterfaceError("test_exception")
     test_source_id = 2
     with self.assertRaises(InterfaceError):
         storage.get_source(test_source_id, "error", Mock)