Revision 2dcc717f

View differences:

src/image_mad/remotes/fs/fsrc
1
#!/bin/bash
2

  
3
# -------------------------------------------------------------------------- #
4
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             #
5
#                                                                            #
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
7
# not use this file except in compliance with the License. You may obtain    #
8
# a copy of the License at                                                   #
9
#                                                                            #
10
# http://www.apache.org/licenses/LICENSE-2.0                                 #
11
#                                                                            #
12
# Unless required by applicable law or agreed to in writing, software        #
13
# distributed under the License is distributed on an "AS IS" BASIS,          #
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
15
# See the License for the specific language governing permissions and        #
16
# limitations under the License.                                             #
17
#--------------------------------------------------------------------------- #
18

  
19
#------------------------------------------------------------------------------
20
# Configuration File for File-System based Image Repositories
21
#------------------------------------------------------------------------------
22
export IMAGE_REPOSITORY_PATH=$ONE_LOCATION/var/images
23

  
24
#------------------------------------------------------------------------------
25
# Function used to generate Image names, you should not need to override this
26
#------------------------------------------------------------------------------
27
function generate_image_path {
28

  
29
CANONICAL_STR="`$DATE +%s`:$ID"
30

  
31
CANONICAL_MD5=$($MD5SUM - << EOF
32
$CANONICAL_STR
33
EOF
34
)
35

  
36
echo "$IMAGE_REPOSITORY_PATH/`echo $CANONICAL_MD5 | cut -d ' ' -f1`"
37
}

Also available in: Unified diff