Unverified Commit 812f232f authored by patelia's avatar patelia Committed by GitHub
Browse files

Merge pull request #20 from eddieramirez/fix-for-additional-arguments

Fix for additional unexpected arguments
parents 78286c54 1acab15a
......@@ -11,7 +11,7 @@ set -ex
BASE_DIR=$(pwd)
BUILD_ROOT=${BASE_DIR}/build/debbuild
VERSION=1.5
VERSION=1.6
echo 'Cleaning deb build workspace'
rm -rf ${BUILD_ROOT}
......
Package: amazon-efs-utils
Architecture: all
Version: 1.5
Version: 1.6
Section: utils
Depends: python|python2, nfs-common, stunnel4 (>= 4.56)
Priority: optional
......
......@@ -20,7 +20,7 @@
%endif
Name : amazon-efs-utils
Version : 1.5
Version : 1.6
Release : 1%{?dist}
Summary : This package provides utilities for simplifying the use of EFS file systems
......
......@@ -54,7 +54,7 @@ except ImportError:
from urllib.error import URLError
from urllib.request import urlopen
VERSION = '1.5'
VERSION = '1.6'
CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf'
CONFIG_SECTION = 'mount'
......@@ -499,8 +499,9 @@ def parse_arguments(config, args=None):
fsname = args[1]
if len(args) > 2:
mountpoint = args[2]
if len(args) > 4 and args[3] == '-o':
options = parse_options(args[4])
if len(args) > 4 and '-o' in args[:-1]:
options_index = args.index('-o') + 1
options = parse_options(args[options_index])
if not fsname or not mountpoint:
usage(out=sys.stderr)
......
......@@ -25,7 +25,7 @@ try:
except ImportError:
from configparser import ConfigParser
VERSION = '1.5'
VERSION = '1.6'
CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf'
CONFIG_SECTION = 'mount-watchdog'
......
......@@ -77,6 +77,16 @@ def test_parse_arguments_custom_path():
assert {} == options
def test_parse_arguments_verbose():
fsid, path, mountpoint, options = mount_efs.parse_arguments(None,
['mount', 'fs-deadbeef:/home', '/dir', '-v', '-o', 'foo,bar=baz,quux'])
assert 'fs-deadbeef' == fsid
assert '/home' == path
assert '/dir' == mountpoint
assert {'foo': None, 'bar': 'baz', 'quux': None} == options
def test_parse_arguments():
fsid, path, mountpoint, options = mount_efs.parse_arguments(None,
['mount', 'fs-deadbeef:/home', '/dir', '-o', 'foo,bar=baz,quux'])
......
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