Changeset 771
- Timestamp:
- 09/04/08 11:40:24 (3 months ago)
- Location:
- ares/trunk
- Files:
-
- 2 modified
-
ares.py (modified) (3 diffs)
-
tests/TestAres.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ares/trunk/ares.py
r768 r771 37 37 # Open an Augeas session 38 38 if test: 39 self.root ='fakeroot/' 40 self.net = '192.168.1.0/24' 39 self.root ='fakeroot/' 40 self.net = '192.168.1.0/24' 41 self.fqdn = 'ares.clientdomain.com' 41 42 else: 42 43 self.root = '/' … … 49 50 # Setup classes 50 51 self.ldap = _Ldap(self) 51 self.squid = _Squid(self) 52 self.squid = _Squid(self) 53 self.hostname = _Hostname(self) 54 self.dnsmasq = _Dnsmasq(self) 52 55 53 56 if __name__ == '__main__': … … 221 224 key = '%s/http_access[%d]/allow' % (cfg, len(aug.match(cfg + '/http_access')) + 1) 222 225 aug.set(key, acl_name) 226 227 # 228 # Setup hostname 229 # 230 class _Hostname: 231 232 def __init__(self, ares): 233 self._ares = ares 234 235 def setup(self): 236 cfg = open(self._ares.root + 'etc/hostname', 'w+') 237 cfg.write("%s\n" % (self._ares.fqdn)) 238 cfg.close() 239 240 # 241 # Setup squid 242 # 243 class _Dnsmasq: 244 245 def __init__(self, ares): 246 self._ares = ares 247 self._cfg = '/files/etc/dnsmasq.conf' 248 249 def setup(self): 250 cfg = self._cfg 251 aug = self._ares.aug 252 for key in aug.match(cfg + '/#comment'): 253 if aug.get(key) == 'conf-dir=/etc/dnsmasq.d': 254 aug.move(key, cfg + '/conf-dir') 255 aug.set(cfg + '/conf-dir', '/etc/dnsmasq.d') -
ares/trunk/tests/TestAres.py
r769 r771 17 17 ares.ldap.setup() 18 18 ares.squid.setup() 19 ares.hostname.setup() 20 ares.dnsmasq.setup() 19 21 ares.aug.save() 20 22
