summaryrefslogtreecommitdiff
path: root/azurelinuxagent/common/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'azurelinuxagent/common/conf.py')
-rw-r--r--azurelinuxagent/common/conf.py48
1 files changed, 46 insertions, 2 deletions
diff --git a/azurelinuxagent/common/conf.py b/azurelinuxagent/common/conf.py
index 1a3b0da..9c79d10 100644
--- a/azurelinuxagent/common/conf.py
+++ b/azurelinuxagent/common/conf.py
@@ -24,10 +24,12 @@ import os
import azurelinuxagent.common.utils.fileutil as fileutil
from azurelinuxagent.common.exception import AgentConfigError
+
class ConfigurationProvider(object):
"""
Parse amd store key:values in /etc/waagent.conf.
"""
+
def __init__(self):
self.values = dict()
@@ -66,6 +68,7 @@ class ConfigurationProvider(object):
__conf__ = ConfigurationProvider()
+
def load_conf_from_file(conf_file_path, conf=__conf__):
"""
Load conf file from: conf_file_path
@@ -80,102 +83,143 @@ def load_conf_from_file(conf_file_path, conf=__conf__):
raise AgentConfigError(("Failed to load conf file:{0}, {1}"
"").format(conf_file_path, err))
+
def enable_rdma(conf=__conf__):
- return conf.get_switch("OS.EnableRDMA", False)
+ return conf.get_switch("OS.EnableRDMA", False) or \
+ conf.get_switch("OS.UpdateRdmaDriver", False) or \
+ conf.get_switch("OS.CheckRdmaDriver", False)
+
def get_logs_verbose(conf=__conf__):
return conf.get_switch("Logs.Verbose", False)
+
def get_lib_dir(conf=__conf__):
return conf.get("Lib.Dir", "/var/lib/waagent")
+
def get_dvd_mount_point(conf=__conf__):
return conf.get("DVD.MountPoint", "/mnt/cdrom/secure")
+
def get_agent_pid_file_path(conf=__conf__):
return conf.get("Pid.File", "/var/run/waagent.pid")
+
def get_ext_log_dir(conf=__conf__):
return conf.get("Extension.LogDir", "/var/log/azure")
+
def get_openssl_cmd(conf=__conf__):
return conf.get("OS.OpensslPath", "/usr/bin/openssl")
+
def get_home_dir(conf=__conf__):
return conf.get("OS.HomeDir", "/home")
+
def get_passwd_file_path(conf=__conf__):
return conf.get("OS.PasswordPath", "/etc/shadow")
+
def get_sudoers_dir(conf=__conf__):
return conf.get("OS.SudoersDir", "/etc/sudoers.d")
+
def get_sshd_conf_file_path(conf=__conf__):
return conf.get("OS.SshdConfigPath", "/etc/ssh/sshd_config")
+
def get_root_device_scsi_timeout(conf=__conf__):
return conf.get("OS.RootDeviceScsiTimeout", None)
+
def get_ssh_host_keypair_type(conf=__conf__):
return conf.get("Provisioning.SshHostKeyPairType", "rsa")
+
def get_provision_enabled(conf=__conf__):
return conf.get_switch("Provisioning.Enabled", True)
+
def get_allow_reset_sys_user(conf=__conf__):
return conf.get_switch("Provisioning.AllowResetSysUser", False)
+
def get_regenerate_ssh_host_key(conf=__conf__):
return conf.get_switch("Provisioning.RegenerateSshHostKeyPair", False)
+
def get_delete_root_password(conf=__conf__):
return conf.get_switch("Provisioning.DeleteRootPassword", False)
+
def get_decode_customdata(conf=__conf__):
return conf.get_switch("Provisioning.DecodeCustomData", False)
+
def get_execute_customdata(conf=__conf__):
return conf.get_switch("Provisioning.ExecuteCustomData", False)
+
def get_password_cryptid(conf=__conf__):
return conf.get("Provisioning.PasswordCryptId", "6")
+
def get_password_crypt_salt_len(conf=__conf__):
return conf.get_int("Provisioning.PasswordCryptSaltLength", 10)
+
def get_monitor_hostname(conf=__conf__):
return conf.get_switch("Provisioning.MonitorHostName", False)
+
def get_httpproxy_host(conf=__conf__):
return conf.get("HttpProxy.Host", None)
+
def get_httpproxy_port(conf=__conf__):
- return conf.get("HttpProxy.Port", None)
+ return conf.get_int("HttpProxy.Port", None)
+
def get_detect_scvmm_env(conf=__conf__):
return conf.get_switch("DetectScvmmEnv", False)
+
def get_resourcedisk_format(conf=__conf__):
return conf.get_switch("ResourceDisk.Format", False)
+
def get_resourcedisk_enable_swap(conf=__conf__):
return conf.get_switch("ResourceDisk.EnableSwap", False)
+
def get_resourcedisk_mountpoint(conf=__conf__):
return conf.get("ResourceDisk.MountPoint", "/mnt/resource")
+
+def get_resourcedisk_mountoptions(conf=__conf__):
+ return conf.get("ResourceDisk.MountOptions", None)
+
+
def get_resourcedisk_filesystem(conf=__conf__):
return conf.get("ResourceDisk.Filesystem", "ext3")
+
def get_resourcedisk_swap_size_mb(conf=__conf__):
return conf.get_int("ResourceDisk.SwapSizeMB", 0)
+
def get_autoupdate_gafamily(conf=__conf__):
return conf.get("AutoUpdate.GAFamily", "Prod")
+
def get_autoupdate_enabled(conf=__conf__):
return conf.get_switch("AutoUpdate.Enabled", True)
+
def get_autoupdate_frequency(conf=__conf__):
return conf.get_int("Autoupdate.Frequency", 3600)
+def get_enable_overprovisioning(conf=__conf__):
+ return conf.get_switch("EnableOverProvisioning", False) \ No newline at end of file