K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / landscape / manager /
server ip : 172.67.156.115

your ip : 172.70.80.236

H O M E


Filename/usr/lib/python2.7/dist-packages/landscape/manager/config.py
Size2.4 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified20-Feb-2014 23:01
Last accessed06-Jul-2025 20:06
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
import os

from landscape.deployment import Configuration
from landscape.manager.scriptexecution import ALL_USERS


ALL_PLUGINS = ["ProcessKiller", "PackageManager", "UserManager",
"ShutdownManager", "AptSources", "HardwareInfo",
"KeystoneToken", "HAService"]


class ManagerConfiguration(Configuration):
"""Specialized configuration for the Landscape Manager."""

def make_parser(self):
"""
Specialize L{Configuration.make_parser}, adding many
manager-specific options.
"""
parser = super(ManagerConfiguration, self).make_parser()

parser.add_option("--manager-plugins", metavar="PLUGIN_LIST",
help="Comma-delimited list of manager plugins to "
"use. ALL means use all plugins.",
default="ALL")
parser.add_option("--include-manager-plugins", metavar="PLUGIN_LIST",
help="Comma-delimited list of manager plugins to "
"enable, in addition to the defaults.")
parser.add_option("--script-users", metavar="USERS",
help="Comma-delimited list of usernames that scripts"
" may be run as. Default is to allow all "
"users.")
return parser

@property
def plugin_factories(self):
plugin_names = []
if self.manager_plugins == "ALL":
plugin_names = ALL_PLUGINS[:]
elif self.manager_plugins:
plugin_names = self.manager_plugins.split(",")
if self.include_manager_plugins:
plugin_names += self.include_manager_plugins.split(",")
return [x.strip() for x in plugin_names]

def get_allowed_script_users(self):
"""
Based on the C{script_users} configuration value, return the users that
should be allowed to run scripts.

If the value is "ALL", then
L{landscape.manager.scriptexecution.ALL_USERS} will be returned. If
there is no specified value, then C{nobody} will be allowed.
"""
if not self.script_users:
return ["nobody"]
if self.script_users.strip() == "ALL":
return ALL_USERS
return [x.strip() for x in self.script_users.split(",")]

@property
def store_filename(self):
return os.path.join(self.data_path, "manager.database")