OSDN Git Service

Pull is changed and the name is changed into pull_data.
authorniwa-hideyuki <niwa.hideyuki@jp.fujitsu.com>
Sun, 2 Nov 2014 03:29:21 +0000 (12:29 +0900)
committerniwa-hideyuki <niwa.hideyuki@jp.fujitsu.com>
Sun, 2 Nov 2014 03:29:21 +0000 (12:29 +0900)
lxcf/lib/lxcf-push [deleted file]
lxcf/rest-api/lxcfv1/api_common.py
lxcf/rest-api/lxcfv1/lxcf-api

diff --git a/lxcf/lib/lxcf-push b/lxcf/lib/lxcf-push
deleted file mode 100755 (executable)
index 17bf60f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-# copyright (C) 2014 FUJITSU LIMITED All Rights Reserved
-
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; version 2
-# of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
-# 02110-1301, USA.
-
-# check distro
-DISTRO=`/usr/lib64/lxcf/lxcf-distro`
-
-# check root
-if [ ${EUID:-${UID}} != 0 ]; then
-    echo "error: Because you are not root, you cannot execute this command. "
-    exit 1
-fi
-
-# check args
-if [ $# -lt 1 ]; then
-       echo "usage lxcf push LXCNAME"
-       exit 1
-fi
-
-# check repository directory
-mkdir -p /opt/lxcf_rep
-
-# get snapshots of args
-/usr/lib64/lxcf/lxcf-snapshot -p /opt/lxcf_rep $*
-
-exit 0
-
index 616369a..1403c4c 100755 (executable)
@@ -660,8 +660,8 @@ class api_version(api_common):
     def __init__(self, callcmd):
         super(api_version, self).__init__(callcmd)
 
-# API: pull from repository
-class api_pull(api_common):
+# API: pull_data from repository
+class api_pull_data(api_common):
     def __init__(self):
         self.messages = "no operation"
         self.status = 0
@@ -693,7 +693,7 @@ class api_pull(api_common):
             if (sanity_check(cmdline[1])):
                 # exec command
                 #check = commands.getstatusoutput("/usr/sbin/lxcf "+cmd)
-                check = (0, "OK pull "+cmdline[1])
+                check = (0, "OK pull_data "+cmdline[1])
             else:
                 errorflg = 1
                 check = (255, "error: sanity error ... "+cmdline[1])
@@ -723,7 +723,7 @@ class api_pull(api_common):
 
         try:
            fp = open(file_path,'rb')
-           start_response('303 See Other', [('Content-Disposition', \
+           start_response('200 OK', [('Content-Disposition', \
                 'inline; filename="' + file_name + '"'), \
                 ('Content-Length', file_size), \
                 ('Content-type', 'application/octet-stream')])
index 5796313..550cf31 100755 (executable)
@@ -96,7 +96,7 @@ path_dirs = { \
 '/lxcfv1/sysgen':api_common.api_sysgen(api_common.call_sysgen), \
 '/lxcfv1/sysgen-n':api_common.api_sysgen_n(api_common.call_sysgen_n), \
 '/lxcfv1/version':api_common.api_version(api_common.call_version), \
-'/lxcfv1/pull':api_common.api_pull(), \
+'/lxcfv1/pull_data':api_common.api_pull_data(), \
 }
 
 class ThreadingWsgiServer(ThreadingMixIn, WSGIServer):