Skip to content

Commit 330a0c7

Browse files
author
Ronald van Zantvoort
committed
vRouter defer configure: Resolve merge conflicts
1 parent a2eb0f2 commit 330a0c7

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

systemvm/patches/debian/config/opt/cloud/bin/update_config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ def process(do_merge=True):
5252
qf.setFile(sys.argv[1])
5353
qf.do_merge = do_merge
5454
qf.load(None)
55-
5655
return qf
5756

5857

5958
def process_file():
6059
print "[INFO] process_file"
6160
qf = process()
62-
# Converge
63-
finish_config()
61+
# These can be safely deferred, dramatically speeding up loading times
62+
if not (os.environ.get('DEFER_CONFIG', False) and sys.argv[1] in ('vm_dhcp_entry.json', 'vm_metadata.json')):
63+
# Converge
64+
finish_config()
6465

6566

6667
def process_vmpasswd():

systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ while getopts 'c:' OPTION; do
3232
c) cfg="$OPTARG" ;;
3333
esac; done
3434

35+
export DEFER_CONFIG=true
3536
while read line; do
3637
#comment
3738
if [[ $line == \#* ]]; then
@@ -78,6 +79,10 @@ done < $cfg
7879
# archive the configuration file
7980
mv $cfg /var/cache/cloud/processed/
8081

82+
unset DEFER_CONFIG
83+
# trigger finish_config()
84+
/opt/cloud/bin/configure.py
85+
8186
# Flush kernel conntrack table
8287
log_it "VR config: Flushing conntrack table"
8388
conntrackd -d 2> /dev/null

0 commit comments

Comments
 (0)