diff options
author | Martin Schwenke <martin@meltin.net> | 2010-05-21 15:38:25 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2010-05-21 15:38:25 +1000 |
commit | 7a26f005d2dd106382cabf73301197794ae43698 (patch) | |
tree | eeb94f0b78b66c5099ba45b17938a8e9039fa296 /autocluster | |
parent | 06853207c5c3db2d40a419a2fbb30acbd71203ff (diff) | |
download | autocluster-7a26f005d2dd106382cabf73301197794ae43698.tar.gz autocluster-7a26f005d2dd106382cabf73301197794ae43698.tar.xz autocluster-7a26f005d2dd106382cabf73301197794ae43698.zip |
Fold setup_network() into setup_base().
Actually add it to setup_base_hooks but ensure that if $hosts_file is
unset then the function returns without doing anything.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'autocluster')
-rwxr-xr-x | autocluster | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/autocluster b/autocluster index 051ffa6..ccb0c31 100755 --- a/autocluster +++ b/autocluster @@ -226,7 +226,6 @@ create_node_configure_image () mount_disk "$disk" setup_base "$type" - setup_network unmount_disk } @@ -315,6 +314,8 @@ sanity_check_cluster_name () Some cluster filesystems have problems with other characters." } +hosts_file= + common_nodelist_hacking () { # Rework the NODES list @@ -745,8 +746,13 @@ setup_base() # setup various networking components setup_network() { - echo "Setting up networks" + if [ -z "$hosts_file" ] ; then + echo "Skipping network-related setup" + return + fi + + echo "Setting up networks" cat $hosts_file >>mnt/etc/hosts echo "Setting up /etc/ctdb/nodes" @@ -767,6 +773,8 @@ setup_network() { echo '@@@YUM_TEMPLATE@@@' | substitute_vars - > mnt/etc/yum.repos.d/autocluster.repo } +register_hook setup_base_hooks setup_network + setup_timezone() { [ -z "$TIMEZONE" ] && { [ -r /etc/timezone ] && { |