Coder Social home page Coder Social logo

fabtools's Introduction

About

fabtools includes useful functions to help you write your Fabric files.

fabtools makes it easier to manage system users, packages, databases, etc.

fabtools includes a number of low-level actions, as well as a higher level interface called fabtools.require.

Using fabtools.require allows you to use a more declarative style, similar to Chef or Puppet.

Installing

To install the latest release from PyPI

$ pip install fabtools

To install the latest development version from GitHub

$ pip install git+git://github.com/ronnix/fabtools.git

Example

Here is an example fabfile.py using fabtools

from fabric.api import *
from fabtools import require
import fabtools

@task
def setup():

    # Require some Debian/Ubuntu packages
    require.deb.packages([
        'imagemagick',
        'libxml2-dev',
    ])

    # Require a Python package
    with fabtools.python.virtualenv('/home/myuser/env'):
        require.python.package('pyramid')

    # Require an email server
    require.postfix.server('example.com')

    # Require a PostgreSQL server
    require.postgres.server()
    require.postgres.user('myuser', 's3cr3tp4ssw0rd')
    require.postgres.database('myappsdb', 'myuser')

    # Require a supervisor process for our app
    require.supervisor.process('myapp',
        command='/home/myuser/env/bin/gunicorn_paster /home/myuser/env/myapp/production.ini',
        directory='/home/myuser/env/myapp',
        user='myuser'
        )

    # Require an nginx server proxying to our app
    require.nginx.proxied_site('example.com',
        docroot='/home/myuser/env/myapp/myapp/public',
        proxy_url='http://127.0.0.1:8888'
        )

    # Setup a daily cron task
    fabtools.cron.add_daily('maintenance', 'myuser', 'my_script.py')

Supported targets

fabtools currently supports the following target operating systems:

  • full support:
    • Debian family:
      • Debian 6 (squeeze), 7 (wheezy), 8 (jessie)
      • Ubuntu 10.04 (lucid), 12.04 (precise), 14.04 (trusty)
  • partial support:
    • RedHat family:
      • RHEL 5/6
      • CentOS 5/6
      • Scientific Linux 5/6
      • Fedora
    • Arch Linux, Manjaro Linux
    • Gentoo
    • SmartOS (Joyent)

Contributions to help improve existing support and extend it to other Unix/Linux distributions are welcome!

fabtools's People

Contributors

adamrt avatar badele avatar davidcaste-glass avatar deronnax avatar disko avatar erning avatar frankier avatar frankrousseau avatar hobbestigrou avatar iiie avatar jitakirin avatar johnykov avatar kamilchm avatar laurentb avatar lfolco avatar mjbommar avatar nicfit avatar pahaz avatar return1 avatar roblabla avatar ronnix avatar rybakit avatar scalp42 avatar sebastibe avatar ssteinerx avatar stephane-klein avatar tony avatar troyjfarrell avatar vperron avatar wnp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabtools's Issues

Add timezone / localtime functions

It might be useful to add system.set_timezone, system.get_timezone and require.system.timezone functions. Currently, I'm using the following functions for my Ubuntu servers:

def set_timezone(timezone):
  run_as_root('echo "%s" > /etc/timezone' % timezone)
  run_as_root('dpkg-reconfigure --frontend noninteractive tzdata')
  require.service.restarted('cron')

def require_timezone(timezone):
  with settings(hide('commands'), warn_only=True):
    result = run('grep -q "^%s$" /etc/timezone' % timezone)
    ret_code = result.return_code
  if ret_code == 0:
    return
  elif ret_code == 1:
    set_timezone(timezone)
  else:
    raise SystemExit()

Of course it would need more to work on all supported distributions.

Postgresql installation.

Hello, i've got some issues using fabtools, could you please help me to solve it:

[[email protected]] sudo: sed -i.bak -r -e '/en_US.UTF-8\ UTF-8/ s/^([[:space:]]*)#[[:space:]]?/\1/g' "$(echo /etc/locale.gen)"
[[email protected]] out: sudo: export: command not found
[[email protected]] out:

Fatal error: sudo() received nonzero return code 1 while executing!

Requested: sed -i.bak -r -e '/en_US.UTF-8\ UTF-8/ s/^([[:space:]])#[[:space:]]?/\1/g' "$(echo /etc/locale.gen)"
Executed: sudo -S -p 'sudo password:' export PATH="$PATH:"/srv/sites/reeliner"" && sed -i.bak -r -e '/en_US.UTF-8\ UTF-8/ s/^([[:space:]]
)#[[:space:]]?/\1/g' "$(echo /etc/locale.gen)"

Aborting.
Disconnecting from [email protected]... done.

here's the code I try:
require.postgres.database(env.database_name, env.user)

require.supervisor seems to need a supervisord.conf file

I get the following error without it:

[zzz] sudo: supervisorctl update
[zzz] out: Error: No config file found at default paths
(/home/fermigier/env/etc/supervisord.conf,
/home/fermigier/env/supervisord.conf, supervisord.conf,
etc/supervisord.conf, /etc/supervisord.conf); use the -c option to specify a
config file at a different path
[zzz] out: For help, use /home/fermigier/env/bin/supervisorctl -h

Don't use os.path.join for remote paths

See: fabric/fabric#306

Fabric doesn't use os.path.join for remote paths, since this screws things up for clients that don't use '' as the local path separator (i.e. Windows)

(one place this shows up is in require.python.virtualenv)

Recommend that fabtools follows the same policy.

Change the github url to readthedocs

There is no link to the readthedocs documentation on github (only on pypi). You should change the url in the admin section. Or at least add a link in the readme.

Templates?

Hi,

First - fabtools looks great. It's exactly what I'm looking for in terms of lightweight server configuration. In fact, I have a half-finished, broken version of the same idea sitting in a git repo somewhere.

However, it's not clear from the README how complete the project is at the moment. For example: the nginx example in the README passes a dictionary of data which is (I think) intended to be combined with a template (templates/nginx/sites/<server_name>.conf). But there's no information about how to create the templates and where to put them. It looks like the template location should be configurable, but as far as I can tell it isn't.

Sorry this issue is a bit vague - I used a specific problem (templates) to highlight a wider question. It'd be nice to know what to focus on when contributing to the project (assuming you're looking for contributions).

hardcoded is_pip_installed parsing code

I am using pythonbrew to use multiple python version. I put pythonbrew script to my .profile, so I can run pythonbrew automatically when I logged in. However, fabtools is_pip_installed function in python.py has hardcoded pip version parsing, therefore it parses wrong.

For example,
When I execute pythonbrew it says
Switched to Python-2.7.3
Due to this output, is_pip_installed parse this string also by installed = res.split(' ')[1] raising following error.

ValueError: invalid version number 'to'

I think you should do more delicate parsing using regex.

def is_pip_installed(version=None, pip_cmd='pip'):
    """
    Check if `pip`_ is installed.

    .. _pip: http://www.pip-installer.org/
    """
    with settings(hide('running', 'warnings', 'stderr', 'stdout'), warn_only=True):
        res = run('%(pip_cmd)s --version 2>/dev/null' % locals())
        if res.failed:
            return False
        if version is None:
            return res.succeeded
        else:
            installed = res.split(' ')[1]
            if V(installed) < V(version):
                puts("pip %s found (version >= %s required)" % (installed, version))
                return False
            else:
                return True

In pip function use unnecessary logic.

Need delete distribute() call.

def pip(version=None):
    """
    Require `pip`_ to be installed.
    """
    distribute()
    if not is_pip_installed(version):
        install_pip()

use_sudo keyword mean run_as_root

This is not the expected behaviour.

with settings(sudo_user='ronnix'):
    fabtools.require.directory('/tmp/foo', use_sudo=True)

if connected as root, it will create the directory as root instead of ronnix user.

sudo is not only used to gain root privileges. It can also be used to execute commands as another user.

export failing

Is there any good reason I'd be seeing this when running fabtools.require.python.virtualenv()?

alapidas@liger ~/code/pickem $ fab setup_dev_environment
[localhost] local: pwd
path = /home/alapidas/code/pickem
[localhost] local: mkdir -p /home/alapidas/code/pickem/venv
[localhost] Login password for 'alapidas':

Fatal error: run() received nonzero return code 127 while executing!

Requested: uname -s
Executed: /bin/bash "export PATH="$PATH:"/home/alapidas/code/pickem"" && uname -s"

================================================== Standard output ==================================================

/bin/bash: export PATH="$PATH:"/home/alapidas/code/pickem"" && uname -s: No such file or directory

Aborting.
Disconnecting from localhost... done.

Locale functions are broken in Ubuntu

Ubuntu uses /var/lib/locales/supported.d instead of /etc/locale.gen. This breaks fabtools locale functions and makes tests fail:

➜  fabtools git:(master) python -m unittest discover
[localhost] local: vagrant box list

Warning: local() encountered an error (return code 127) while executing 'vagrant box list'

..E...........
======================================================================
ERROR: test_params_respected (fabtools.tests.test_postgres.PostgresTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/coldwind/dev/repos/fabtools/fabtools/tests/test_postgres.py", line 23, in test_params_respected
    encoding='some_encoding', template='some_template')
  File "/home/coldwind/dev/repos/fabtools/fabtools/require/postgres.py", line 90, in database
    with watch('/etc/locale.gen') as locales:
AttributeError: __exit__

----------------------------------------------------------------------
Ran 14 tests in 0.004s

FAILED (errors=1)

Error in fabtools.python.install, python -m pip syntax don't work with python 2.6

When I execute fabtools/tests/fabfiles/python.py, I've this bug :

[[email protected]:2222] sudo: python -m pip install  virtualenv
[[email protected]:2222] out: stdin: is not a tty
[[email protected]:2222] out: /usr/bin/python: pip is a package and cannot be directly executed

More complete trace :

[[email protected]:2222] run: curl --silent -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
[[email protected]:2222] sudo: python get-pip.py
[[email protected]:2222] out: stdin: is not a tty
[[email protected]:2222] out: Downloading/unpacking pip
[[email protected]:2222] out:   Running setup.py egg_info for package pip
[[email protected]:2222] out:     warning: no files found matching '*.html' under directory 'docs'
[[email protected]:2222] out:     warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
[[email protected]:2222] out:     no previously-included directories found matching 'docs/_build/_sources'
[[email protected]:2222] out: Installing collected packages: pip
[[email protected]:2222] out:   Found existing installation: pip 1.3.1
[[email protected]:2222] out:     Uninstalling pip:
[[email protected]:2222] out:       Successfully uninstalled pip
[[email protected]:2222] out:   Running setup.py install for pip
[[email protected]:2222] out:     warning: no files found matching '*.html' under directory 'docs'
[[email protected]:2222] out:     warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
[[email protected]:2222] out:     no previously-included directories found matching 'docs/_build/_sources'
[[email protected]:2222] out:     Installing pip script to /usr/local/bin
[[email protected]:2222] out:     Installing pip-2.6 script to /usr/local/bin
[[email protected]:2222] out: Successfully installed pip
[[email protected]:2222] out: Cleaning up...
[[email protected]:2222] out:

[[email protected]:2222] sudo: python -m pip install  virtualenv
[[email protected]:2222] out: stdin: is not a tty
[[email protected]:2222] out: /usr/bin/python: pip is a package and cannot be directly executed
[[email protected]:2222] out:


Fatal error: sudo() received nonzero return code 1 while executing!

Requested: python -m pip install  virtualenv
Executed: sudo -S -p 'sudo password:'  /bin/bash -l -c "export http_proxy=\"\" && python -m pip install  virtualenv"

I suggest that you use python -m pip ... and not pip ... to specify python version.
On my desktop, python -m pip --version working because I've python 2.7.

In vagrant VM, python -m pip --version didn't work because python 2.6 is installed.

I think that fabtools.python.install must work with python 2.6, then we can't use python -m pip syntax.

user_exists for mysql should support host

If there are several users with the same name but with different hosts then users_exists will report that user does not exist.

That's due to result of query. It contains more than one row and strict 'res == name' check fails.

The lsb_release command is not available on some Debian VPS installs

Using fabtools.system.distrib_codename() doesn't seem to work on Debian wheezy, at least a stock install.

Fatal error: run() received nonzero return code 127 while executing!

Requested: lsb_release --codename --short
Executed: /bin/bash -l -c "lsb_release --codename --short"

=============================== Standard output ===============================

/bin/bash: lsb_release: command not found

Aborting.

require.distro.package

How about this common function?

new file: fabtools/require/distro.py

from fabtools.require.deb import package as require_deb_package
from fabtools.require.rpm import package as require_rpm_package

def package(pkg_name, update=False, version=None):
    family = distrib_family()

    if family == 'debian':
        require_deb_package(pkg_name)

    elif family == 'redhat':
        require_rpm_package(pkg_name)

def packages()
    '...'

This can be used in require.python.setuptools()

    from fabtools.require.distro import packages as require_distro_packages
    if not is_setuptools_installed(python_cmd=python_cmd):
        require_distro_packages([
            'curl',
            'python-dev',
        ])

        install_setuptools(python_cmd=python_cmd)

I can send a pull request, if it is OK.

Automaticaly set use_sudo to False if I'm connected with root user

Hi,

If fabric is connected with "root" user, I need to use this code to install package :

require.deb.packages(['python-2.6', 'build-essential'], use_sudo=False)

I need to set "use_sudo=False".

I wonder if it's to possible in packages method to detect if I'm "root" user or not… and if I'm root user then use_sudo is set to False ?

Best regards,
Stephane

Bash Tilde Expansion

I don't know if it's already known, but fabtools.require.directory("/foo"). That maps to running mkdir -p "/foo", and quoting the path to mkdir means that bash tilde expansion doesn't operate. Assuming you haven't specified a working path you end up with:

/home/myuser/~/foo

rather than

/home/myuser/foo

I don't know about anyone else, but a directory called ~ inside my home directory caused my brain to explode.

I don't know if it's worth considering switching to escaping spaces in paths, or maybe just updating the documentation to say not to use ~?

Note: fabtools.require.directory("$HOME/foo") is an easy work around once you know the problem exists.

make fabtools.python.virtualenv usable with local()

Because fabric's local function uses /bin/sh by default, rather than /bin/bash, the fabtools.python.virtualenv cannot be used with the local function.

You get something like this:
{{{
/bin/sh: source: not found
}}}

It would be really handy if the virtualenv context manager was usable locally as well.

I think this is as easy as changing the 'source' string to '.'

Alternately there could be a separate lvenv context manager.

Python 2.5 compatibility

Fabric supports Python 2.5, so we should too.

At least, we need to add some from __future__ import with_statement statements where we use with.

Is anything else needed?

started() for postgresql

Hi (bonjour en fait)

I always saw postgresql launch script installed in Ubuntu as /etc/init.d/postgresql, without any version number
Perhaps it's different in other distros ?

For now this line in fabtool/icanhaz/postgres.py server() function
started('postgresql-%s' % version)

throws an error, as expected :
Fatal error: sudo() encountered an error (return code 127) while executing '/etc/init.d/postgresql-8.4 start'

Minor bug with fabtools.python.install

This code in python.py seems to assume that you can run python -m pip if you have python 2.7 or later. However, if you happen to have an older pip version installed -- for example pip 1.1 in a virtual environment -- that command will fail because pip doesn't have the appropriate pip.__main__ module.

version = _get_python_version(use_python).split('.')

if (int(version[0]) < 3) and (int(version[1]) < 7):
    command = 'pip-%s.%s' % (version[0], version[1])
else:
    command = '%(use_python)s -m pip' % locals()

command += ' install %(options)s %(packages)s' % locals()
$ python --version
Python 2.7.3
$ pip --version
pip 1.0 from /usr/lib/python2.7/dist-packages (python 2.7)
$ python -m pip
/usr/bin/python: No module named pip.__main__; 'pip' is a package and cannot be directly executed

Vagrant boxes for functional tests

Fabtools Vagrant tests are really great but if we want to be compatible with listed systems we need to have set of base Vagrant boxes to run tests on.
I'm using some custom Ubutnu, Debian and CentOS boxes from http://www.vagrantbox.es/ now.
Can we do list of Vagrant boxes URL for each supported system?

I can start with ones that I'm using now:

fabtools.cron is very basic

Even though the docstring for the module says that it's for managing crontab tasks you can't really manage tasks only add new files to /var/cron.d/

I've previously used buildout to add tasks to the user crontab and the recipe provides an interesting crontab manager:

http://svn.zope.org/z3c.recipe.usercrontab/trunk/src/z3c/recipe/usercrontab/usercrontab.py?view=markup

This manager allows you to add and remove tasks to an users cron file.

Do you think it's feasible to adapt this crontab manager to fabtools? Are you interested in extending the fabtools.cron module?

Python 3.3 Compatibility

~|⇒ python3 --version
Python 3.3.2

I'm try to install:

~|⇒ pip install fabtools
Downloading/unpacking fabtools
  Downloading fabtools-0.14.0.tar.gz (61kB): 61kB downloaded
  Running setup.py egg_info for package fabtools

    warning: no previously-included files matching '*' found under directory 'docs/_build'
Requirement already satisfied (use --upgrade to upgrade): fabric>=1.6.0 in ./virtualenv/lib/python3.3/site-packages (from fabtools)
Requirement already satisfied (use --upgrade to upgrade): paramiko>=1.10.0 in ./virtualenv/lib/python3.3/site-packages (from fabric>=1.6.0->fabtools)
Requirement already satisfied (use --upgrade to upgrade): pycrypto>=2.1,!=2.4 in ./virtualenv/lib/python3.3/site-packages (from paramiko>=1.10.0->fabric>=1.6.0->fabtools)
Installing collected packages: fabtools
  Running setup.py install for fabtools

    warning: no previously-included files matching '*' found under directory 'docs/_build'
      File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabtools/openvz/contextmanager.py", line 162
        lmode = lmode & 07777
                            ^
    SyntaxError: invalid token

Successfully installed fabtools
Cleaning up...

Try to use after install:

~|python
Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fabtools import require
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabtools/__init__.py", line 2, in <module>
    import fabtools.arch
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabtools/arch.py", line 11, in <module>
    from fabric.api import hide, run, settings
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabric/api.py", line 9, in <module>
    from fabric.context_managers import (cd, hide, settings, show, path, prefix,
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabric/context_managers.py", line 533
    def accept(channel, (src_addr, src_port), (dest_addr, dest_port)):
                        ^
SyntaxError: invalid syntax
>>> import fabtools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabtools/__init__.py", line 2, in <module>
    import fabtools.arch
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabtools/arch.py", line 11, in <module>
    from fabric.api import hide, run, settings
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabric/api.py", line 9, in <module>
    from fabric.context_managers import (cd, hide, settings, show, path, prefix,
  File "/Users/drakmail/virtualenv/lib/python3.3/site-packages/fabric/context_managers.py", line 533
    def accept(channel, (src_addr, src_port), (dest_addr, dest_port)):
                        ^
SyntaxError: invalid syntax

Require()ing a Postgres 9.2 server

I'd like to help out with supporting Postgres 9.2 installation on Ubuntu (there is no postgres-9.2 package for Ubuntu, and probably not on Debian either, but not sure). Right now, some solid packages are available here:

https://wiki.postgresql.org/wiki/Apt

.. and there's a shell script to add the appropriate APT repo here:

https://github.com/pgexperts/add-pgdg-apt-repo

What would be the best way to support requiring a Postgres 9.2 server if the installation process is more complicated than 'apt get update && apt-get install [postgres package name]' due to the local of the relevant APT repos?

can't create a mysql user and a database

Hi,
I'm trying to use fabtools to create a user and a database under mysql with the following commands (in a Vagrant squeeze virtualbox):

require.mysql.server(password='root')
require.mysql.user('toto', password='toto')
require.mysql.database('toto', owner='toto')

Mysql is installed but I have the following error when trying to create user and database :

[localhost] out: Setting up mysql-server (5.1.66-0+squeeze1) ...
[localhost] out: 

[localhost] out: ERROR 1045 (28000): Access denied for user 'None'@'localhost' (using password: YES)
[localhost] out: 

Fatal error: sudo() received nonzero return code 1 while executing!

Requested: mysql --batch --raw --skip-column-names --user=None --password=None --execute="CREATE USER 'toto'@'localhost' IDENTIFIED BY 'toto';"
Executed: sudo -S -p 'sudo password:'  /bin/bash -l -c "mysql --batch --raw --skip-column-names --user=None --password=None --execute=\"CREATE USER 'toto'@'localhost' IDENTIFIED BY 'toto';\""

Aborting.
Disconnecting from localhost... done.

What did I got wrong ? I can see a lot of None values in the mysql commands.

Here are my users in my mysql :

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+

mysql> select user, Host from user;
+------------------+------------------------+
| user             | Host                   |
+------------------+------------------------+
| root             | 127.0.0.1              |
| debian-sys-maint | localhost              |
| root             | localhost              |
| root             | vagrant-debian-squeeze |
+------------------+------------------------+

fabtools.postgres.user_exists() quick fix

For some reasons (gremlins ?) the test (res == "1") does not work even if the psql command returns "1"
I found it worked better using ("1" in res), without any str.strip(), etc...

Upstart support

Hi there,

Would you be willing to merge in patches to support upstart jobs? Sample API:

# fabtools.upstart
upstart.start('mysql')
upstart.restart('mysql')
upstart.stop('mysql')

# require.upstart
require.upstart.running('mysql')
require.upstart.stopped('mysql')

If the above API looks ok, I'll try to write a patch for this.

Release?

Hi,
Is there a chance of a release? The main thing I'm after is the changes to postgres.py, since 0.4 on pypi.

Cheers,
Stuart

OpenVZ tools don't work anymore

Hi ronnix,

Since the Fabric 1.5.0 release, Fabtools OpenVZ commands don't work anymore. It complains about not finding the quiet import from fabric.api . I'm ok to make a pull request for that but I don't know where to start. Could you point me what to do to solve this problem ?

Whatever thanks for fabtools which helps us a lot.

Frank

0.9.3 is not usable

Trying to use it, or running the tests with tox, gives:

  File "/home/fermigier/git/fabtools/fabtools/__init__.py", line 4, in <module>
    import fabtools.group
ImportError: No module named group

Problem with system.locale(), /var/lib/locales/supported.d/local: No such file or directory

When I use this fonction fabtools.require.system.locale('fr_FR.UTF-8')

I get this error message

[[email protected]:2222] sudo: echo 'fr_FR.UTF-8 UTF-8' >> /var/lib/locales/supported.d/local
[[email protected]:2222] out: /bin/bash: /var/lib/locales/supported.d/local: No such file or directory

Fatal error: sudo() received nonzero return code 1 while executing!

Requested: echo 'fr_FR.UTF-8 UTF-8' >> /var/lib/locales/supported.d/local
Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "echo 'fr_FR.UTF-8 UTF-8' >> /var/lib/locales/supported.d/local"

Aborting.

Warning: md5sum: /var/lib/locales/supported.d/local: No such file or directory

My full script is here http://pastebin.com/aVPW41Xb

Fabric version 1.4.3
Fabtools version 0.7.0
Vagrant version 1.0.3
Virtualbox image Debian Squeeze AMD 64 https://s3-eu-west-1.amazonaws.com/rosstimson-vagrant-boxes/Debian-Squeeze-64-rvm.box

require.postgres.database() references /etc/locale.gen

require.postgres.database references /etc/locale.gen which doesn't exist on my system. The only system I can find references is for Arch Linux.

I'd happily supply a patch but I'm not sure what file we need to watch on other systems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.