Changeset 1653:f58aeda2a341

Show
Ignore:
Timestamp:
06/11/08 16:51:53 (2 months ago)
Author:
klai@…
Branch:
default
Message:

Use /etc/tycoon/defaults for storing defaults configuration information

Files:
2 added
7 removed
9 modified
1 copied
2 moved

Legend:

Unmodified
Added
Removed
  • MANIFEST.in

    r1627 r1653  
    11include src/scripts/* 
    2 include src/tycoon.conf 
    32include src/tycoon*.repo 
    4 include src/bank_public_key 
    5 include src/tycoon_aucd_local.conf.in 
    6 include src/tycoon_dist_auc.conf 
    7 include src/tycoon_dist_auc.conf.user 
     3include etc/* 
    84 
    95 
  • etc/tycoon/defaults/tycoon.conf

    r1652 r1653  
    22# Warning: do not modify this file. Modifications will be overwritten 
    33# when the tycoon packages are upgraded. Instead, put configuration changes 
    4 # in /etc/tycoon/tycoon_aucd_local.conf (for the auctioneer) or  
     4# in /etc/tycoon/tycoon_aucd.conf (for the auctioneer),  
     5# /etc/tycoon/tycoon.conf (for all users on the host), or  
    56# ~/.tycoon/tycoon.conf (for individual users). Values set in those files  
    67# will supercede the values in this file. 
  • packaging/fedora_core_3/tycoon_aucd/etc/tycoon/defaults/tycoon_aucd.conf

    r1652 r1653  
    22# Warning: do not modify this file. Modifications will be overwritten 
    33# when the tycoon packages are upgraded. Instead, put configuration changes 
    4 # in /etc/tycoon/tycoon_aucd_local.conf (for the auctioneer) or  
     4# in /etc/tycoon/tycoon_aucd.conf (for the auctioneer),  
     5# /etc/tycoon/tycoon.conf (for all users on the host), or  
    56# ~/.tycoon/tycoon.conf (for individual users). Values set in those files  
    67# will supercede the values in this file. 
  • packaging/fedora_core_3/tycoon_aucd/etc/tycoon/tycoon_aucd.conf

    r1652 r1653  
    11#! /usr/bin/env python 
    2 # Warning: do not modify this file. Modifications will be overwritten 
    3 # when the tycoon packages are upgraded. Instead, put configuration changes 
    4 # in /etc/tycoon/tycoon_aucd_local.conf (for the auctioneer) or  
    5 # ~/.tycoon/tycoon.conf (for individual users). Values set in those files  
    6 # will supercede the values in this file. 
    7  
    8 # The file to log to or None for stderr 
    9 LoggingFileName = "/var/log/tycoon_aucd.log" 
    10  
    11 # The location of the user's bank private key 
    12 PrivateKeyFileName = "/etc/tycoon/%(BankAccountName)s_bank_private_key" 
    13 SecondPassOptions['PrivateKeyFileName'] = True 
    14  
    15 # The location of the user's bank public key 
    16 PublicKeyFileName = "/etc/tycoon/%(BankAccountName)s_bank_public_key" 
    17 SecondPassOptions['PublicKeyFileName'] = True 
    18  
    19 # The location of the user's bank private key 
    20 AdminPublicKeyFileName = "/etc/tycoon/admin_public_key" 
    21  
    22 # Whether to run as a daemon 
    23 Daemonize = True 
    24  
    25 # The location of the account database 
    26 TycoonDirectory = "/var/lib/tycoon" 
    27 Directory = "aucd" 
    28 PrivateDirectory = "private" 
    29 AccountDatabaseFileName = "accounts.db" 
    30 DatabaseFileName = "data.db" 
    31  
    32 BankReplayDetectionBufferFileName = "/var/lib/tycoon/aucd/private/bank_replay_detection_buffer" 
    33 AccountReplayDetectionBufferFileName = "replay_detection_buffer" 
    34  
    35 # The location of virtual machine monitor data 
    36 # The full path is Directory + VMMDirectory 
    37 VMMDirectory = "%(Virtualization)s" 
    38 SecondPassOptions['VMMDirectory'] = True 
    39  
    40 VMMPrivateDirectory = "private" 
    41  
    42 # The location of virtual machine monitor libraries 
    43 # The full path is VMMDirectory + VMMLibraryDirectory 
    44 VMMLibraryDirectory = "lib" 
    45  
    46 VMMAccountsDirectory = "accounts" 
    47  
    48 # The name of the virtual machine monitor's account database. 
    49 # The full path is VMMLibraryDirectory + VMMAccountDatabaseFileName 
    50 VMMAccountDatabaseFileName = "accounts.db" 
    51  
    52 # The TCPv4 ports to exclude from dynamic allocation 
    53 VMMTCPv4ExcludedPorts = [] 
    54  
    55 # The name fields used for generation of a host key. 
    56 HostKeyNameFields = { 
    57     "C": "US", "ST": "California", "L": "Palo Alto", "O": "Hewlett-Packard", 
    58     "OU": "HP Labs"} 
    59  
    60 # The file containing the x509 private key for this host  
    61 SSLPrivateKeyFileName = "private_key.pem" 
    62  
    63 # The file containing the x509 certificate for this host 
    64 SSLCertificateFileName = "certificate.pem" 
    65  
    66 # The files containing the x509 certificates for the certificate authorities 
    67 AuthorityCertificateFileNames = ("keys/ca_certificate.pem",) 
    68  
    69 # The ssh port number used to log into this machine. 
    70 SSHPortNumber = 22 
    71  
    72 # The allowable file system URLS 
    73 AllowedFileSystemImageRegexs = ( 
    74     "http://tycoon.hpl.hp.com/~tycoon/dl/images/.+", 
    75     "file:///var/lib/tycoon/aucd/Xen303/lib/.+", 
    76     ) 
    77  
    78 # The default file system image 
    79 DefaultFileSystemImage = "http://tycoon.hpl.hp.com/~tycoon/dl/images/centos.5-0.ext3.bz2" 
    80  
    81 # The files to copy into the new file systems. 
    82 FileSystemFiles = ( 
    83     ("/etc", ("/etc/resolv.conf", )), 
    84     ) 
    85  
    86 # The interval for allocation and accounting 
    87 AccountingInterval = 60.0 
    88  
    89 AllocationAlgorithm = "Proportional Share" 
    90  
    91 # The characteristics of resources. The fields are as follows: 
    92 #   max allocated: the maximum amount that will be allocated 
    93 #                  None indicates that all of it should be allocated 
    94 #   reserved: the amount within the allocated that will be reserved for 
    95 #             system operations. None indicates a resource-specific 
    96 #             algorithm should be used. 
    97 #   info: resource-specific information 
    98 Resources = { 
    99     'CPU': {0: {'reserved': "1 GHz"}}, 
    100     'memory': {0: {}}, 
    101     'disk': {0: {'reserved': "4 GiB"}}, 
    102     'NetworkInterfaceIncoming': { 
    103     0: {'capacity': "1 Gbit/s", 'reserved': "32 kbit/s"}}, 
    104     'NetworkInterfaceOutgoing': { 
    105     0: {'capacity': "1 Gbit/s", 'reserved': "32 kbit/s"}}, 
    106     'TCPv4Port': { 
    107     (1, 21): {'capacity': 1}, 
    108     (23, AuctioneerPortNumber - 1): {'capacity': 1}, 
    109     (AuctioneerPortNumber + 1, 2**16 - 1): {'capacity': 1}, 
    110     # ssh 
    111     22: {'capacity': 1, 'reserved': 1}, 
    112     # The auctioneer itself 
    113     AuctioneerPortNumber: {'capacity': 1, 'reserved': 1}, 
    114     }, 
    115     'IPv4Address': { 
    116     # This is only an example 
    117     #("10.0.0.3", "10.0.0.10"): { 
    118     #'capacity': 1, 'default_lease_time': 300, 'max_lease_time': 300, 
    119     #'routers': "10.0.0.1", 'subnet_mask': "255.255.255.0", 
    120     #'broadcast_address': "10.0.0.255",  'name_servers': ("10.0.0.2",)} 
    121     } 
    122 } 
    123  
    124 # Extra fields to register with the service location service 
    125 SLSRegistrationFields = ( 
    126     # Information about the machine's owner 
    127     # These are only examples. Put the real ones in /etc/tycoon_aucd_local.conf 
    128     #("OwnerURL", "http://tycoon.hpl.hp.com"), 
    129     #("OwnerIcon", "http://tycoon.hpl.hp.com/~tycoon/dl/pictures/HPL-48x48.png"), 
    130 ) 
    131  
    132 # Use this to prevent auctioneers behind firewalls from being discovered 
    133 # by users who cannot access them. The structure is as follows: 
    134 # [ (network_address, netmask), 
    135 # ] 
    136 # where only clients on the subnet (network_address & netmask) can access 
    137 # this auctioneer. 
    138 NetworkAccessibility = [(0, 0)] 
     2# This file is for custom configuration that applies to all users and tycoon  
     3# applications on this host. The variables set in this file supercede those  
     4# in /etc/tycoon/defaults/tycoon_aucd.conf 
  • packaging/fedora_core_3/tycoon_aucd/setup.py.template

    r1652 r1653  
    1212    def _make_spec_file(self): 
    1313        self.config_files = [ 
     14            '/etc/tycoon/defaults/tycoon_aucd.conf',  
    1415            '/etc/tycoon/tycoon_aucd.conf',  
    1516            '/etc/logrotate.d/tycoon_aucd', 
     
    2122                f.append("%%config %s" % (cf,)) 
    2223 
    23         f.append("%%attr(444, root, root) /etc/tycoon/tycoon_aucd.conf") 
     24        f.append( 
     25            "%%attr(444, root, root) /etc/tycoon/defaults/tycoon_aucd.conf") 
    2426        return f 
    2527 
     
    5355    scripts          = ['usr/bin/tycoon_aucd'], 
    5456    data_files       = [ 
     57    ('/etc/tycoon/defaults/tycoon', ['etc/tycoon/defaults/tycoon_aucd.conf',]), 
    5558    ('/etc/tycoon', ['etc/tycoon/tycoon_aucd.conf',]), 
    5659    ('/etc/logrotate.d', ['etc/logrotate.d/tycoon_aucd',]), 
  • setup.py.template

    r1652 r1653  
    1212    def _make_spec_file(self): 
    1313        self.config_files = [ 
    14             '/etc/tycoon/tycoon.conf', '/etc/tycoon/tycoon_dist_auc.conf', 
    15             '/etc/tycoon/tycoon_aucd_local.conf.in',  
    16             '/etc/tycoon/tycoon_dist_auc.conf.user', 
     14            '/etc/tycoon/tycoon.conf',  
    1715            '/etc/tycoon/bank_public_key', 
     16            '/etc/tycoon/defaults/tycoon.conf',  
    1817            '/etc/yum.repos.d/tycoon_$distribution_code$.repo', 
    1918            ] 
     
    2221            for cf in self.config_files: 
    2322                f.append("%%config %s" % (cf,)) 
    24         f.append("%%attr(444, root, root) /etc/tycoon/tycoon.conf") 
     23        f.append("%%attr(444, root, root) /etc/tycoon/defaults/tycoon.conf") 
    2524        return f 
    2625 
     
    7271    ], 
    7372    data_files       = [ 
    74     ('/etc/tycoon', [ 
    75     'src/tycoon.conf', 'src/tycoon_dist_auc.conf', 
    76     'src/tycoon_aucd_local.conf.in', 'src/tycoon_dist_auc.conf.user', 
    77     'src/bank_public_key',  
    78     ]), 
     73    ('/etc/tycoon', ['etc/tycoon/tycoon.conf', 'etc/tycoon/bank_public_key']), 
     74    ('/etc/tycoon/default', ['etc/tycoon/default/tycoon.conf']), 
    7975    ('/etc/yum.repos.d', ['src/tycoon_$distribution_code$.repo']), 
    8076    ], 
  • src/Tycoon/Auctioneer.py

    r1643 r1653  
    124124        self.__main = Main( 
    125125            "tycoon_aucd", 
    126             ("tycoon.conf", "tycoon_aucd.conf", "tycoon_aucd_vmm.conf", 
    127              "tycoon_aucd_local.conf"), ("/etc/tycoon",), ol, reactor, 
     126            ("tycoon.conf", "tycoon_aucd.conf", "tycoon_aucd_vmm.conf"), 
     127            ("/etc/tycoon/defaults", "/etc/tycoon",), ol, reactor, 
    128128            summary, description, (), version=self.__version, usage=usage,) 
    129129         
  • src/Tycoon/CmdLineAuctioneer.py

    r1503 r1653  
    195195        # but not user-specific options. 
    196196        aucd_options = Options( 
    197             ("tycoon.conf", "tycoon_aucd.conf", "tycoon_aucd_vmm.conf", 
    198              "tycoon_aucd_local.conf"), ("/etc/tycoon",), DefaultOptionList) 
     197            ("tycoon.conf", "tycoon_aucd.conf", "tycoon_aucd_vmm.conf"),  
     198            ("/etc/tycoon/defaults", "/etc/tycoon",), DefaultOptionList) 
    199199        aucd_options.parse([]) 
    200200         
     
    210210        # Pick up owner information from ~root/.tycoon 
    211211        owner_options = Options( 
    212             ("tycoon.conf", ), ("/etc/tycoon", "~root/.tycoon",), 
     212            ("tycoon.conf", ),  
     213            ("/etc/tycoon/defaults", "/etc/tycoon", "~root/.tycoon",), 
    213214            DefaultOptionList) 
    214215        owner_options.parse([]) 
     
    230231        shutil.copyfile(pub_src, admin_key_fn) 
    231232 
    232         fn = "/etc/tycoon/tycoon_aucd_local.conf" 
     233        fn = "/etc/tycoon/tycoon_aucd.conf" 
    233234        un_found = False 
    234235        if os.path.isfile(fn): 
  • src/Tycoon/ServiceLocationService.py

    r1642 r1653  
    110110        self.__main = Main( 
    111111            "tycoon_sls", ("tycoon.conf", "tycoon_sls.conf"), 
    112             ("/etc/tycoon", "~/.tycoon"), ol, reactor, summary, description, 
    113             (), version=version, usage=usage,) 
     112            ("/etc/tycoon/defaults", "/etc/tycoon"), ol, reactor, summary,  
     113            description, (), version=version, usage=usage,) 
    114114 
    115115        self.__options = self.__main.options 
  • src/Tycoon/Ssh.py

    r1368 r1653  
    9898        self.__main = Main( 
    9999            "tycoon", ("tycoon.conf",), 
    100             ("/etc/tycoon", os.environ.get('TYCOON_CONFIG_PATH','~/.tycoon')),  
     100            ("/etc/tycoon/defaults", "/etc/tycoon",  
     101             os.environ.get('TYCOON_CONFIG_PATH','~/.tycoon')),  
    101102            ol, reactor, summary, description, (), version = version, 
    102103            usage = usage, argv = sys.argv[0:i]) 
  • src/Tycoon/Tycoon.py

    r1189 r1653  
    9191        self.__main = Main( 
    9292            "tycoon", ("tycoon.conf",), 
    93             ("/etc/tycoon", os.environ.get('TYCOON_CONFIG_PATH','~/.tycoon')), 
     93            ("/etc/tycoon/defaults", "/etc/tycoon",  
     94             os.environ.get('TYCOON_CONFIG_PATH','~/.tycoon')), 
    9495            ol, reactor, summary, description, subcommands, version = version, 
    9596            usage = usage,)