+++ /dev/null
-#!/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
-
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
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])
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')])
'/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):