From f952605e58e9d900a57ed7ffbf6842b7a458d9a6 Mon Sep 17 00:00:00 2001 From: Fred Park Date: Fri, 17 Mar 2017 19:32:44 -0700 Subject: [PATCH] Fix server options arg parsing --- convoy/remotefs.py | 10 ++++++---- scripts/shipyard_remotefs_bootstrap.sh | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/convoy/remotefs.py b/convoy/remotefs.py index de6582e..ea91eca 100644 --- a/convoy/remotefs.py +++ b/convoy/remotefs.py @@ -538,7 +538,7 @@ def _create_virtual_machine( def _create_virtual_machine_extension( compute_client, rfs, bootstrap_file, blob_urls, vm_name, disks, - private_ips, offset): + private_ips, offset, verbose=False): # type: (azure.mgmt.compute.ComputeManagementClient, # settings.RemoteFsSettings, str, List[str], str, dict, List[str], # int) -> msrestazure.azure_operation.AzureOperationPoller @@ -552,6 +552,7 @@ def _create_virtual_machine_extension( :param dict disks: data disk map :param list private_ips: list of static private ips :param int offset: vm number + :param bool verbose: verbose logging :rtype: msrestazure.azure_operation.AzureOperationPoller :return: msrestazure.azure_operation.AzureOperationPoller """ @@ -607,7 +608,8 @@ def _create_virtual_machine_extension( ','.join(rfs.storage_cluster.file_server.mount_options) if util.is_not_empty(rfs.storage_cluster.file_server.mount_options) else '')) - # logger.debug('bootstrap command: {}'.format(cmd)) + if verbose: + logger.debug('bootstrap command: {}'.format(cmd)) logger.debug('creating virtual machine extension: {}'.format(vm_ext_name)) return compute_client.virtual_machine_extensions.create_or_update( resource_group_name=rfs.storage_cluster.resource_group, @@ -851,7 +853,7 @@ def create_storage_cluster( functools.partial( _create_virtual_machine_extension, compute_client, rfs, bootstrap_file, blob_urls, vms[i].name, disk_map, - private_ips, i), + private_ips, i, settings.verbose(config)), max_retries=0, ) logger.debug('waiting for virtual machine extensions to be created') @@ -1105,7 +1107,7 @@ def resize_storage_cluster( functools.partial( _create_virtual_machine_extension, compute_client, rfs, bootstrap_file, blob_urls, vms[i].name, disk_map, private_ips, - i), + i, settings.verbose(config)), max_retries=0, ) logger.debug('adding {} bricks to gluster volume'.format( diff --git a/scripts/shipyard_remotefs_bootstrap.sh b/scripts/shipyard_remotefs_bootstrap.sh index 7007ce4..23af792 100755 --- a/scripts/shipyard_remotefs_bootstrap.sh +++ b/scripts/shipyard_remotefs_bootstrap.sh @@ -201,10 +201,10 @@ setup_glusterfs() { echo "Creating gluster volume $gluster_volname $volarg ($force$bricks)" gluster volume create $gluster_volname $volarg transport $transport$bricks $force # modify volume properties as per input - for e in ${so[@]:3}; do + for e in "${so[@]:3}"; do IFS=':' read -ra kv <<< "$e" echo "Setting volume option ${kv[@]}" - gluster volume set $gluster_volname ${kv[0]} ${kv[1]} + gluster volume set $gluster_volname "${kv[0]}" "${kv[1]}" done fi # start volume @@ -357,6 +357,7 @@ echo " Tune TCP parameters: $optimize_tcp" echo " Premium storage: $premium_storage" echo " RAID level: $raid_level" echo " Server type: $server_type" +echo " Server options: $server_options" echo " Hostname prefix: $hostname_prefix" echo " Peer IPs: $peer_ips" echo " IP address of VM: $ipaddress"