Revision aeb0c953
b/tools/cfgupgrade | ||
---|---|---|
122 | 122 |
options.SERVER_PEM_PATH = options.data_dir + "/server.pem" |
123 | 123 |
options.KNOWN_HOSTS_PATH = options.data_dir + "/known_hosts" |
124 | 124 |
options.RAPI_CERT_FILE = options.data_dir + "/rapi.pem" |
125 |
options.HMAC_CLUSTER_KEY = options.data_dir + "/hmac.key" |
|
125 | 126 |
|
126 | 127 |
SetupLogging() |
127 | 128 |
|
... | ... | |
159 | 160 |
raise Error("Inconsistent configuration: found config_version in" |
160 | 161 |
" configuration file") |
161 | 162 |
|
163 |
if config_major == 2 and config_minor == 0: |
|
164 |
if config_revision != 0: |
|
165 |
logging.warning("Config revision is not 0") |
|
166 |
|
|
167 |
config_data["version"] = constants.BuildVersion(2, 1, 0) |
|
168 |
|
|
162 | 169 |
try: |
163 | 170 |
logging.info("Writing configuration file to %s", options.CONFIG_DATA_PATH) |
164 | 171 |
utils.WriteFile(file_name=options.CONFIG_DATA_PATH, |
... | ... | |
172 | 179 |
logging.debug("Writing RAPI certificate to %s", options.RAPI_CERT_FILE) |
173 | 180 |
bootstrap.GenerateSelfSignedSslCert(options.RAPI_CERT_FILE) |
174 | 181 |
|
182 |
if not os.path.exists(options.HMAC_CLUSTER_KEY): |
|
183 |
logging.debug("Writing HMAC key to %s", options.HMAC_CLUSTER_KEY) |
|
184 |
bootstrap.GenerateHmacKey(options.HMAC_CLUSTER_KEY) |
|
185 |
|
|
175 | 186 |
except: |
176 | 187 |
logging.critical("Writing configuration failed. It is probably in an" |
177 | 188 |
" inconsistent state and needs manual intervention.") |
Also available in: Unified diff