mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
feature #1112: Remove unnecessary files from install.sh and the 'mv' datastore scripts
This commit is contained in:
parent
950ef37b69
commit
3ae8efbd0c
@ -529,8 +529,6 @@ INSTALL_ETC_FILES=(
|
||||
VMWARE_ETC_FILES:$ETC_LOCATION
|
||||
VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2
|
||||
VMM_EXEC_ETC_FILES:$ETC_LOCATION/vmm_exec
|
||||
DATASTORE_DRIVER_FS_ETC_FILES:$ETC_LOCATION/datastore/
|
||||
DATASTORE_DRIVER_VMWARE_ETC_FILES:$ETC_LOCATION/datastore/
|
||||
IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2
|
||||
TM_LVM_ETC_FILES:$ETC_LOCATION/tm/
|
||||
HM_ETC_FILES:$ETC_LOCATION/hm
|
||||
@ -808,21 +806,15 @@ TM_VMWARE_FILES="src/tm_mad/vmware/clone \
|
||||
# - VMware based Image Repository, $REMOTES_LOCATION/datastore/vmware
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
DATASTORE_DRIVER_FS_ETC_FILES="src/datastore_mad/remotes/fs/fs.conf"
|
||||
|
||||
DATASTORE_DRIVER_VMWARE_ETC_FILES="src/datastore_mad/remotes/vmware/vmware.conf"
|
||||
|
||||
DATASTORE_DRIVER_COMMON_SCRIPTS="src/datastore_mad/remotes/xpath.rb \
|
||||
src/datastore_mad/remotes/libfs.sh"
|
||||
|
||||
DATASTORE_DRIVER_FS_SCRIPTS="src/datastore_mad/remotes/fs/cp \
|
||||
src/datastore_mad/remotes/fs/mkfs \
|
||||
src/datastore_mad/remotes/fs/mv \
|
||||
src/datastore_mad/remotes/fs/rm"
|
||||
|
||||
DATASTORE_DRIVER_VMWARE_SCRIPTS="src/datastore_mad/remotes/vmware/cp \
|
||||
src/datastore_mad/remotes/vmware/mkfs \
|
||||
src/datastore_mad/remotes/vmware/mv \
|
||||
src/datastore_mad/remotes/vmware/rm"
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -1,38 +0,0 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
# PRESERVE BASH SYNTAX
|
||||
|
||||
#*******************************************************************************
|
||||
# DEFAULT Configuration File for File-System based Datastores
|
||||
#-------------------------------------------------------------------------------
|
||||
# BASE_PATH: Path where the images will be stored. If not defined
|
||||
# defaults to /var/lib/one/images or $ONE_LOCATION/var/images
|
||||
#
|
||||
# RESTRICTED_DIRS: Paths that can not be used to register images. A space
|
||||
# separated list of paths. This prevents users to access important files like
|
||||
# oned.db or /etc/shadow. OpenNebula will automatically add its configuration
|
||||
# dirs:/var/lib/one, /etc/one and oneadmin's home ($HOME).
|
||||
#
|
||||
# SAFE_DIRS: Paths that are safe to specify image paths. A space separated list
|
||||
# of paths.This will allow you to open specific paths within RESTRICTED_DIRS
|
||||
#*******************************************************************************
|
||||
|
||||
#BASE_PATH=/var/lib/one/images
|
||||
|
||||
RESTRICTED_DIRS="/etc/"
|
||||
|
||||
SAFE_DIRS="$HOME/public/"
|
@ -1,75 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
###############################################################################
|
||||
# This script is used to move a VM image (SRC) to the image repository as DST
|
||||
# Several SRC types are supported
|
||||
###############################################################################
|
||||
|
||||
# ------------ Set up the environment to source common tools ------------
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
LIB_LOCATION=/usr/lib/one
|
||||
else
|
||||
LIB_LOCATION=$ONE_LOCATION/lib
|
||||
fi
|
||||
|
||||
. $LIB_LOCATION/sh/scripts_common.sh
|
||||
source $(dirname $0)/fsrc
|
||||
|
||||
SRC=$1
|
||||
DST=$2
|
||||
ID=$3
|
||||
|
||||
# ------------ Generate a filename for the image ------------
|
||||
|
||||
if [ "$DST" = "-" ] ; then
|
||||
DST=`generate_image_path`
|
||||
fi
|
||||
|
||||
# ------------ Move the image to the repository ------------
|
||||
|
||||
case $SRC in
|
||||
http://*)
|
||||
log "Downloading $SRC to the image repository"
|
||||
exec_and_log "$WGET -O $DST $SRC" \
|
||||
"Error downloading $SRC"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Moving local image $SRC to the image repository"
|
||||
|
||||
if [ \( -L $SRC \) -a \
|
||||
\( "`$READLINK -f $SRC`" = "`$READLINK -f $DST`" \) ] ; then
|
||||
log "Not moving files to image repo, they are the same"
|
||||
else
|
||||
exec_and_log "mv -f $SRC $DST" "Could not move $SRC to $DST"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -d $DST ]; then
|
||||
exec_and_log "chmod 0770 $DST"
|
||||
else
|
||||
exec_and_log "chmod 0660 $DST"
|
||||
fi
|
||||
|
||||
# ---------------- Get the size of the image ------------
|
||||
SIZE=`fs_du $DST`
|
||||
|
||||
echo "$DST $SIZE"
|
@ -1,75 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
###############################################################################
|
||||
# This script is used to move a VM image (SRC) to the image repository as DST
|
||||
# Several SRC types are supported
|
||||
###############################################################################
|
||||
|
||||
# ------------ Set up the environment to source common tools ------------
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
LIB_LOCATION=/usr/lib/one
|
||||
else
|
||||
LIB_LOCATION=$ONE_LOCATION/lib
|
||||
fi
|
||||
|
||||
. $LIB_LOCATION/sh/scripts_common.sh
|
||||
source $(dirname $0)/fsrc
|
||||
|
||||
SRC=$1
|
||||
DST=$2
|
||||
ID=$3
|
||||
|
||||
# ------------ Generate a filename for the image ------------
|
||||
|
||||
if [ "$DST" = "-" ] ; then
|
||||
DST=`generate_image_path`
|
||||
fi
|
||||
|
||||
# ------------ Move the image to the repository ------------
|
||||
|
||||
case $SRC in
|
||||
http://*)
|
||||
log "Downloading $SRC to the image repository"
|
||||
exec_and_log "$WGET -O $DST $SRC" \
|
||||
"Error downloading $SRC"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Moving local image $SRC to the image repository"
|
||||
|
||||
if [ \( -L $SRC \) -a \
|
||||
\( "`$READLINK -f $SRC`" = "`$READLINK -f $DST`" \) ] ; then
|
||||
log "Not moving files to image repo, they are the same"
|
||||
else
|
||||
exec_and_log "mv -f $SRC $DST" "Could not move $SRC to $DST"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -d $DST ]; then
|
||||
exec_and_log "chmod 0770 $DST"
|
||||
else
|
||||
exec_and_log "chmod 0660 $DST"
|
||||
fi
|
||||
|
||||
# ---------------- Get the size of the image ------------
|
||||
SIZE=`fs_du $DST`
|
||||
|
||||
echo "$DST $SIZE"
|
@ -1,38 +0,0 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
# PRESERVE BASH SYNTAX
|
||||
|
||||
#*******************************************************************************
|
||||
# DEFAULT Configuration File for File-System based Datastores
|
||||
#-------------------------------------------------------------------------------
|
||||
# BASE_PATH: Path where the images will be stored. If not defined
|
||||
# defaults to /var/lib/one/images or $ONE_LOCATION/var/images
|
||||
#
|
||||
# RESTRICTED_DIRS: Paths that can not be used to register images. A space
|
||||
# separated list of paths. This prevents users to access important files like
|
||||
# oned.db or /etc/shadow. OpenNebula will automatically add its configuration
|
||||
# dirs:/var/lib/one, /etc/one and oneadmin's home ($HOME).
|
||||
#
|
||||
# SAFE_DIRS: Paths that are safe to specify image paths. A space separated list
|
||||
# of paths.This will allow you to open specific paths within RESTRICTED_DIRS
|
||||
#*******************************************************************************
|
||||
|
||||
#BASE_PATH=/var/lib/one/images
|
||||
|
||||
RESTRICTED_DIRS="/etc/"
|
||||
|
||||
SAFE_DIRS="$HOME/public/"
|
Loading…
x
Reference in New Issue
Block a user