~bkerensa/ubuntu/precise/landscape-client/fix-for-962974

« back to all changes in this revision

Viewing changes to landscape/sysinfo/deployment.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2010-02-10 18:50:53 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20100210185053-kqyzavz3rkpkl7nx
Tags: 1.4.4-0ubuntu0.10.04
* New upstream release (LP: #519200):
  - Add a message for creating package locks (LP: #514334)
  - Add support for auto-approved change-packages messages (LP: #517175)
  - Add support for installing server-generated debian packages (LP: #509752)
  - Add support for reporting Eucalyptus topology information (LP: #518501)
  - Fix timeout while inserting large free-space message (LP: #218388)
  - Fix wrong log path in motd (LP: #517454)
  - Fix race condition in process excecution (LP: #517453)

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
                           % (plugin_name.lower(), plugin_name))()
61
61
                for plugin_name in plugins]
62
62
 
63
 
 
64
 
def setup_logging(landscape_dir=None):
 
63
def get_landscape_log_directory(landscape_dir=None):
 
64
    """
 
65
    Work out the correct path to store logs in depending on the effective
 
66
    user id of the current process.
 
67
    """
65
68
    if landscape_dir is None:
66
69
        if os.getuid() == 0:
67
70
            landscape_dir = "/var/log/landscape"
68
71
        else:
69
72
            landscape_dir = os.path.expanduser("~/.landscape")
70
 
 
 
73
    return landscape_dir
 
74
 
 
75
 
 
76
def setup_logging(landscape_dir=None):
 
77
    landscape_dir = get_landscape_log_directory(landscape_dir)
71
78
    logger = getLogger("landscape-sysinfo")
72
79
    logger.propagate = False
73
80
    if not os.path.isdir(landscape_dir):