~james-page/charms/precise/nova-compute/nvp-support

« back to all changes in this revision

Viewing changes to hooks/nova-compute-common

  • Committer: Adam Gandelman
  • Date: 2012-05-11 18:50:24 UTC
  • Revision ID: adamg@canonical.com-20120511185024-c351wzde71z1q2tt
Allow user-defined nova.conf flags in charm config. Add config-changed hook

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  fi
29
29
}
30
30
 
 
31
function set_config_flags() {
 
32
  # Set user-defined nova.conf flags from deployment config
 
33
  juju-log "Processing config-flags."
 
34
  flags=$(config-get config-flags)
 
35
  if [[ "$flags" != "None" && -n "$flags" ]] ; then
 
36
    for f in $(echo $flags | sed -e 's/,/ /g') ; do
 
37
      k=$(echo $f | cut -d= -f1)
 
38
      v=$(echo $f | cut -d= -f2)
 
39
      set_or_update "$k" "$v"
 
40
    done
 
41
  fi
 
42
}
 
43
 
31
44
function nova_ctl_status {
32
45
  SERVICE=$1
33
46
  # workaround upstarts lack of scriptable return codes