import logging
import shutil
import sqlalchemy
+import random
+import string
import wizard
from wizard import resolve, scripts, shell, util
parametrized_files = []
#: Keys that are used in older versions of the application, but
#: not for the most recent version.
- deprecated_keys = []
+ deprecated_keys = set()
+ #: Keys that we can simply generate random strings for if they're missing
+ random_keys = set()
#: Dictionary of variable names to extractor functions. These functions
#: take a :class:`wizard.deploy.Deployment` as an argument and return the value of
#: the variable, or ``None`` if it could not be found.
result = {}
for k,extractor in self.extractors.items():
result[k] = extractor(deployment)
+ # XXX: ugh... we have to do quoting
+ for k in self.random_keys:
+ if result[k] is None:
+ result[k] = "'%s'" % ''.join(random.choice(string.letters + string.digits) for i in xrange(30))
return result
def dsn(self, deployment):
"""
substitutions.update(php.substitutions)
install_schema = install.ArgSchema("db", "email", "title")
deprecated_keys = set(['WIZARD_SECRETKEY'])
+ random_keys = set(['WIZARD_SECRETKEY', 'WIZARD_AUTH_KEY', 'WIZARD_SECURE_AUTH_KEY', 'WIZARD_LOGGED_IN_KEY', 'WIZARD_NONCE_KEY'])
def download(self, version):
return "http://wordpress.org/wordpress-%s.tar.gz" % version
def checkConfig(self, deployment):
# check if we want to punt due to --limit
if d.location in seen:
continue
- if is_root and not command.security_check_homedir(d):
+ if is_root and not command.security_check_homedir(d.location):
continue
logging.info("Processing %s" % d.location)
child_args = list(base_args)