Merge pull request #35 from vexxhost/api-changes

Change way to verify the retention user.
diff --git a/staffeln/api/app.py b/staffeln/api/app.py
index 80c1bb2..9552746 100755
--- a/staffeln/api/app.py
+++ b/staffeln/api/app.py
@@ -3,7 +3,6 @@
 from flask import request

 from staffeln import objects

 from staffeln.common import context

-from staffeln.common import openstack

 from oslo_log import log

 

 

@@ -15,18 +14,13 @@
 

 @app.route("/v1/backup", methods=["POST"])

 def backup_id():

-    openstacksdk = openstack.OpenstackSDK()

-    retention_user_id = openstacksdk.get_user_id()

     

-    if not "user_id" in request.args or not "backup_id" in request.args:

+    if "backup_id" not in request.args:

         # Return error if the backup_id argument is not provided.

         return Response(

-            "Error: backup_id or user_id is missing.", status=403, mimetype="text/plain"

+            "Error: backup_id is missing.", status=403, mimetype="text/plain"

         )

 

-    if retention_user_id == request.args["user_id"]:

-        return Response("True", status=200, mimetype="text/plain")

-

     # Retrive the backup object from backup_data table with matching backup_id.

     backup = objects.Volume.get_backup_by_backup_id(ctx, request.args["backup_id"])

     # backup_info is None when there is no entry of the backup id in backup_table.