Changeset 797
- Timestamp:
- 09/06/08 13:49:42 (3 months ago)
- Location:
- ares/trunk
- Files:
-
- 2 modified
-
ares.py (modified) (2 diffs)
-
tests/TestAres.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ares/trunk/ares.py
r795 r797 62 62 self.fetchmail = _Fetchmail(self) 63 63 self.samba = _Samba(self) 64 self.nfs = _Nfs(self) 64 65 self.postconfig = _Postconfig(self) 65 66 … … 499 500 aug.set(rec + '/directory mask', '0775') 500 501 502 # Stop here if we not running as root 503 aug = self._ares.aug 504 if aug.get('/augeas/root') == 'fakeroot/': 505 return 506 501 507 data = '/srv/data' 508 502 509 if not os.path.exists(data): 503 510 os.mkdir(data) 511 504 512 os.chown(data, 0, grp.getgrnam('users')[2]) 505 513 os.chmod(data,0775) 514 506 515 cmd = 'chmod g+s %s' % data 507 516 if os.system(cmd) != 0: 508 517 raise AresError('F: %s' % cmd) 518 519 # 520 # Nfs 521 # 522 class _Nfs: 523 524 def __init__(self, ares): 525 self._ares = ares 526 self._cfg = '/files/etc/exports' 527 528 def setup(self): 529 530 aug = self._ares.aug 531 cfg = self._cfg 532 533 dirs = [ aug.get(key) for key in aug.match(cfg + '/dir') ] 534 for dir in [ '/home', '/srv/data' ]: 535 if dir not in dirs: 536 key = cfg + '/dir[%d]' % (len(dirs)+1) 537 aug.set(key, dir) 538 aug.set(key + '/client', '*') 539 aug.set(key + '/client/option[1]', 'rw') 540 aug.set(key + '/client/option[2]', 'sync') 541 aug.set(key + '/client/option[3]', 'no_root_squash') 509 542 510 543 # -
ares/trunk/tests/TestAres.py
r795 r797 14 14 15 15 def test_ldap(self): 16 ares = Ares(test= False)16 ares = Ares(test=True) 17 17 ares.ldap.setup() 18 18 ares.squid.setup() … … 25 25 ares.amavis.setup() 26 26 ares.spamassassin.setup() 27 ares.fetchmail.setup() 27 28 ares.samba.setup() 28 ares. fetchmail.setup()29 ares.nfs.setup() 29 30 ares.aug.save() 30 31 ares.postconfig.setup()
