~termie/pantheon/fabric-init-fabric

« back to all changes in this revision

Viewing changes to fabric/pantheon.py

  • Committer: Aaron Levy
  • Date: 2010-07-22 22:26:10 UTC
  • Revision ID: aaron@chapterthree.com-20100722222610-1rrhhhp3gruk4pth
move get_server_settings() to pantheon library

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    ret['db_name'] = url.path[1:].replace('\n','')
35
35
 
36
36
    return ret
 
37
 
 
38
def _get_server_settings():
 
39
    ret = {}
 
40
    # Default Ubuntu
 
41
    if exists('/etc/debian_version'):
 
42
        ret['webroot'] = '/var/www/'
 
43
        ret['owner'] = 'root'
 
44
        ret['group'] = 'www-data'
 
45
        ret['distro'] = 'ubuntu'
 
46
    # Default Centos
 
47
    elif exists('/etc/redhat-release'):
 
48
        ret['webroot'] = '/var/www/html/'
 
49
        ret['owner'] = 'root'
 
50
        ret['group'] = 'apache'
 
51
        ret['distro'] = 'centos'
 
52
    ret['ip'] = (local('hostname --ip-address')).rstrip('\n')
 
53
    return ret
 
54