~martin-nowack/maas/fix-enlistment

« back to all changes in this revision

Viewing changes to src/provisioningserver/utils/script.py

  • Committer: Andres Rodriguez
  • Date: 2015-02-24 13:52:12 UTC
  • Revision ID: andreserl@ubuntu.com-20150224135212-p1hw9crzz4s5g4g5
Revert to bzr3553 as 3554 was a mistake commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from provisioningserver.utils.fs import atomic_write
28
28
 
29
 
# NOTE! NOTE NOTE!
30
 
#
31
 
# DUPLICATING THESE IN TWO PLACES FOR THE MOMENT UNTIL A SIGNLE LOCATION IS SELECTED
32
 
#
33
 
# NOTE! NOTE NOTE!
34
 
 
35
 
CLUSTERD_DB_PATH = '/var/lib/maas/clusterd.db'
36
29
 
37
30
class ActionScript:
38
31
    """A command-line script that follows a command+verb pattern."""
99
92
 
100
93
    The `--config-file` option defaults to the value of
101
94
    `MAAS_PROVISIONING_SETTINGS` in the process's environment, or absent
102
 
    that, or when running from branch, the equivalent
 
95
    that, `$MAAS_CONFIG_DIR/pserv.yaml` (normally /etc/maas/pserv.yaml for
 
96
    packaged installations, or when running from branch, the equivalent
103
97
    inside that branch).
104
98
    """
105
99
 
106
100
    def __init__(self, description):
107
101
        # Avoid circular imports.
 
102
        from provisioningserver.config import Config
108
103
 
109
104
        super(MainScript, self).__init__(description)
110
105
        self.parser.add_argument(
111
106
            "-c", "--config-file", metavar="FILENAME",
112
107
            help="Configuration file to load [%(default)s].",
113
 
            default=CLUSTERD_DB_PATH)
 
108
            default=Config.DEFAULT_FILENAME)
114
109
 
115
110
 
116
111
class AtomicWriteScript: