Commits

Mikhail Korobov  committed cf83f89

fails loudly in install_common_software if OS is unknown

  • Participants
  • Parent commits b129a75

Comments (0)

Files changed (1)

File fab_deploy/system.py

 from fabric.api import run, settings, env, cd
 from fabric.contrib.files import append
 from fab_deploy.utils import run_as, detect_os
-from fabric.utils import puts
+from fabric.utils import puts, abort
 
 def prepare_server():
     """ Prepares server: installs system packages. """
 @run_as('root')
 def install_common_software():
     """ Installs common system packages. """
-    os = detect_os()
     common_packages = [
         'python', 'build-essential', 'python-dev', 'python-setuptools',
         'python-profiler', 'libjpeg-dev', 'zlib1g-dev',
         'memcached',
         'subversion',
     ]
-
     extra_packages = {
         'lenny': ['libmysqlclient15-dev'],
         'squeeze': ['libmysqlclient-dev'],
+        'maverick': ['libmysqlclient-dev'],
     }
-    if os in extra_packages:
-        aptitude_install(" ".join(common_packages + extra_packages[os]))
+
+    os = detect_os()
+    if os not in extra_packages:
+        abort('Your OS (%s) is unsupported now.' % os)
+
+    aptitude_install(" ".join(common_packages + extra_packages[os]))
 
     # git and mercurial are outdated in stable Debian Lenny and
     # don't work with some source repositories on github and bitbucket