From 3ae8efbd0ca59927d63d1c06bc865ed39bb09164 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Mon, 5 Mar 2012 11:53:59 +0100 Subject: [PATCH] feature #1112: Remove unnecessary files from install.sh and the 'mv' datastore scripts --- install.sh | 8 --- src/datastore_mad/remotes/fs/fs.conf | 38 ---------- src/datastore_mad/remotes/fs/mv | 75 -------------------- src/datastore_mad/remotes/vmware/mv | 75 -------------------- src/datastore_mad/remotes/vmware/vmware.conf | 38 ---------- 5 files changed, 234 deletions(-) delete mode 100644 src/datastore_mad/remotes/fs/fs.conf delete mode 100755 src/datastore_mad/remotes/fs/mv delete mode 100755 src/datastore_mad/remotes/vmware/mv delete mode 100644 src/datastore_mad/remotes/vmware/vmware.conf diff --git a/install.sh b/install.sh index 0c2304050e..e8403dd398 100755 --- a/install.sh +++ b/install.sh @@ -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" #------------------------------------------------------------------------------- diff --git a/src/datastore_mad/remotes/fs/fs.conf b/src/datastore_mad/remotes/fs/fs.conf deleted file mode 100644 index ec29989e22..0000000000 --- a/src/datastore_mad/remotes/fs/fs.conf +++ /dev/null @@ -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/" diff --git a/src/datastore_mad/remotes/fs/mv b/src/datastore_mad/remotes/fs/mv deleted file mode 100755 index 8ea2259a28..0000000000 --- a/src/datastore_mad/remotes/fs/mv +++ /dev/null @@ -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" diff --git a/src/datastore_mad/remotes/vmware/mv b/src/datastore_mad/remotes/vmware/mv deleted file mode 100755 index 8ea2259a28..0000000000 --- a/src/datastore_mad/remotes/vmware/mv +++ /dev/null @@ -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" diff --git a/src/datastore_mad/remotes/vmware/vmware.conf b/src/datastore_mad/remotes/vmware/vmware.conf deleted file mode 100644 index ec29989e22..0000000000 --- a/src/datastore_mad/remotes/vmware/vmware.conf +++ /dev/null @@ -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/"