Beispiel #1
0
def project_app_approve(request, project_uuid, application_id):
    with ExceptionHandler(request):
        with transaction.commit_on_success():
            approve_application(application_id, project_uuid,
                                request_user=request.user)
            messages.success(request, _(astakos_messages.APPLICATION_APPROVED))
    return redirect(reverse('project_detail', args=(project_uuid,)))
Beispiel #2
0
def project_app_approve(request, project_uuid, application_id):
    with ExceptionHandler(request):
        with transaction.commit_on_success():
            approve_application(application_id, project_uuid,
                                request_user=request.user)
            messages.success(request, _(astakos_messages.APPLICATION_APPROVED))
    return redirect(reverse('project_detail', args=(project_uuid,)))
Beispiel #3
0
def do_project_action(action):

    if action == 'approve':
        return lambda p: pactions.approve_application(p.last_application.id)
    elif action == 'deny':
        return lambda p: pactions.deny_application(p.last_application.id)
    else:
        # The action name should be the same as the function name in
        # astakos.im.functions.
        func = getattr(pactions, action)
        return lambda p: func(p.id)
Beispiel #4
0
def do_project_action(action):

    if action == "approve":
        return lambda p: pactions.approve_application(p.last_application.id)
    elif action == "deny":
        return lambda p: pactions.deny_application(p.last_application.id)
    else:
        # The action name should be the same as the function name in
        # astakos.im.functions.
        func = getattr(pactions, action)
        return lambda p: func(p.id)
Beispiel #5
0
    def setUp(self):
        """Common setUp for all AdminTestCases.

        This setUp method will create and approve a project as well as add
        several Cyclades model instances using Cyclades' model_factory.
        """
        ProjectAPITest.setUp(self)
        # Create a simple project.
        h_owner = {"HTTP_X_AUTH_TOKEN": self.user1.auth_token}

        app1 = {
            "name": "test.pr",
            "description": u"δεσκρίπτιον",
            "end_date": "2113-5-5T20:20:20Z",
            "join_policy": "auto",
            "max_members": 5,
            "resources": {
                u"σέρβις1.ρίσορς11": {
                    "project_capacity": 1024,
                    "member_capacity": 512
                }
            }
        }

        status, body = self.create(app1, h_owner)

        # Ensure that the project application has been created.
        self.assertEqual(status, 201)
        project_id = body["id"]
        app_id = body["application"]

        # Approve the application.
        with transaction.atomic():
            self.project = approve_application(app_id, project_id)
        self.assertIsNotNone(self.project)

        # Alias owner user with a generic name
        self.user = self.user1

        # Create cyclades models.
        self.vm = mf.VirtualMachineFactory()
        self.volume = mf.VolumeFactory()
        self.network = mf.NetworkFactory()
        self.ipv4 = mf.IPv4AddressFactory(address="1.2.3.4")
        self.ipv6 = mf.IPv6AddressFactory(address="::1")
Beispiel #6
0
    def setUp(self):
        """Common setUp for all AdminTestCases.

        This setUp method will create and approve a project as well as add
        several Cyclades model instances using Cyclades' model_factory.
        """
        ProjectAPITest.setUp(self)
        # Create a simple project.
        h_owner = {"HTTP_X_AUTH_TOKEN": self.user1.auth_token}

        app1 = {"name": "test.pr",
                "description": u"δεσκρίπτιον",
                "end_date": "2113-5-5T20:20:20Z",
                "join_policy": "auto",
                "max_members": 5,
                "resources": {u"σέρβις1.ρίσορς11": {
                    "project_capacity": 1024,
                    "member_capacity": 512}}
                }

        status, body = self.create(app1, h_owner)

        # Ensure that the project application has been created.
        self.assertEqual(status, 201)
        project_id = body["id"]
        app_id = body["application"]

        # Approve the application.
        with transaction.atomic():
            self.project = approve_application(app_id, project_id)
        self.assertIsNotNone(self.project)

        # Alias owner user with a generic name
        self.user = self.user1

        # Create cyclades models.
        self.vm = mf.VirtualMachineFactory()
        self.volume = mf.VolumeFactory()
        self.network = mf.NetworkFactory()
        self.ipv4 = mf.IPv4AddressFactory(address="1.2.3.4")
        self.ipv6 = mf.IPv6AddressFactory(address="::1")
Beispiel #7
0
def approve(app_id):
    approve_application(app_id)
Beispiel #8
0
def approve(app_id):
    approve_application(app_id)
Beispiel #9
0
def _project_app_approve(request, application_id):
    approve_application(application_id)
Beispiel #10
0
def _project_app_approve(request, application_id):
    approve_application(application_id)