Commit 39fe8e3e authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Add a parameter for controlling pithcat's umask

Introduce the PITHCAT_UMASK option. This can be used to set the file
mode mask of the pithcat process.
parent ee9d520a
......@@ -123,7 +123,11 @@ case $BACKEND_TYPE in
export PITHCAT_RADOS_POOL_MAPS="$PITHOS_RADOS_POOL_MAPS"
export PITHCAT_RADOS_POOL_BLOCKS="$PITHOS_RADOS_POOL_BLOCKS"
export PITHCAT_ARCHIPELAGO_CONF="$PITHOS_ARCHIPELAGO_CONF"
cmd_args="$(printf "%q" "${IMAGE_NAME}")"
cmd_args=""
if [ -n "${PITHCAT_UMASK+dummy}" ]; then
cmd_args="--umask=$PITHCAT_UMASK"
fi
cmd_args+=" $(printf "%q" "${IMAGE_NAME}")"
image_cmd="./pithcat $cmd_args"
image_size=$(./pithcat -s $cmd_args)
;;
......
......@@ -71,6 +71,10 @@
# PITHOS_ARCHIPELAGO_CONF: Archipelago configuration file
# PITHOS_ARCHIPELAGO_CONF="@sysconfdir@/archipelago/archipelago.conf"
# PITHCAT_UMASK: If set, it will change the file mode mask of the pithcat
# process to the specified one.
# PITHCAT_UMASK=<not set>
# PROGRESS_MONITOR: External program that monitors the progress of the image
# deployment. The snf-image monitor messages will be redirected to the standard
# input of this program.
......
......@@ -27,7 +27,7 @@ the URL as the user when connecting to the backend.
from optparse import OptionParser, OptionGroup
from sys import exit, stdout, stderr
from os import environ
from os import environ, umask
from binascii import hexlify, unhexlify
from collections import namedtuple
from pkg_resources import parse_version
......@@ -96,6 +96,9 @@ parser.add_option('-s', action='store_true', dest='size', default=False,
parser.add_option('--db', dest='db', metavar='URI',
help='SQLAlchemy URI of the database [DANGEROUS: Do not use,'
'see NOTE below]', default=None)
parser.add_option('--umask', dest='umask', metavar='UMASK', type='int',
default=None,
help='change the process\' file mode mask to UMASK')
LocationURL = namedtuple('LocationURL', ['account', 'container', 'object'])
HashmapURL = namedtuple('HashmapURL', ['hash', 'size'])
......@@ -164,6 +167,9 @@ def main():
parser.print_help()
exit(1)
if options.umask is not None:
umask(options.umask)
url = parse_url(args[0])
data_path = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment