Questions tagged [fabric]

A Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. For questions about Google Fabric service, please use the tag [google-fabric]. For questions about FabricJs library, please use [fabricjs]. For questions about Hyperledger Fabric, please use [hyperledger-fabric]. For questions about the Minecraft modding toolchain Fabric, please use [minecraft-fabric].

Fabric provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.

Typical use involves creating a Python module containing one or more functions, then executing them via the fab command-line tool.

1531 questions
0
votes
1 answer

python string conversion

Trying to add user with python fabric script. uid = prompt("Enter username:") eid = prompt("Enter user's email address:") password = generate_passwd() run('adduser -g vpn -c %s %s') % (eid, uid) run("echo -e '%s\n' | passwd %s") % (password,…
jahil
  • 426
  • 1
  • 4
  • 12
0
votes
2 answers

Fabric, can't get default locale on django

I have the following django management command: fabrictest.py from django.core.management.base import NoArgsCommand import locale class Command(NoArgsCommand): def handle_noargs(self, **options): print locale.getdefaultlocale() Which…
0
votes
1 answer

get operation in fabric to use hostname

I am pretty new to fabric and trying to setup a deployment in the below fashion: Main repo --> Local_repo -> Deployment server I want to (1)push the build from the main repo to the local repo (2)Deployment server needs to pull the available code…
Shalini
  • 11
  • 1
0
votes
2 answers

python input variable handling

trying to use input variable inside statement. def email(account): email = fabric.operations.prompt("Enter client's email address:") run('mysql -u %s -p%s -e "UPDATE users SET email = %email WHERE id = 1" %s' % (env.user, dbpasswd,…
jahil
  • 426
  • 1
  • 4
  • 12
0
votes
1 answer

Fabric does not use SSH key

Possible Duplicate: Using an SSH keyfile with Fabric In my fable env.ip = 'x.x.x.x' env.hosts = [env.ip] env.user = 'root' env.environment = 'production' I have the config like this, but when I trying to execute something using run(command),…
user469652
  • 48,855
  • 59
  • 128
  • 165
0
votes
2 answers

Using Fabric to search for and run a file

I'm working on a website using Django and I have Fabric as well, which is very useful for scripting some chunks of code that me and other developers use. I'm pretty new to all of these (and linux in general, tbh) so I have ideas, but I don't know…
Kapura
  • 107
  • 6
0
votes
1 answer

How to force the fabric connect to remote host before run() executed?

I am use fabric to write my rsync wrapper, the variable env.host_string will be set by execute() to run task. To get env.host_string, I run('pwd') first, and run rsync. Is It possible to make sure user set env.hosts before some checkpoint arrived,…
qrtt1
  • 7,746
  • 8
  • 42
  • 62
0
votes
1 answer

fabric don't start twisted application as a daemon

I have written a simple automation script for deploying and restarting my twisted application on remote Debian host. But I have an issue with starting using twistd. I have a run.tac file and start my application as follows inside fabric…
pss
  • 736
  • 3
  • 7
  • 14
0
votes
1 answer

python fabric.contrib.files.contains returns False when text is present in file

My code look like this : run("""echo "%s:x:" """ % (username)) if not contains('/etc/passwd', '%s:x:' % (username)): run("useradd --shell /bin/bash --create-home %s" % (username), pty=True) On first run, it works fine and create the…
Dax
  • 369
  • 2
  • 7
0
votes
2 answers

running fabfile task from django

I have a fabric task eg- def run_task(): #code here From the command prompt I run this task: fab -c env.fabricrc run_task -H hostnamr How can I run this task from django?I click on a button on a webpage in django app and it should do this. How…
0
votes
1 answer

Can't commit from Fabric script for GitHub

I'm using Fabric to run an ANT task & then upload to GitHub. The script has worked, but not consistently so its difficult to understand why. I've been reading on here that the process in Fabric is; git add git commit git push But I keep seeing…
markwalker_
  • 12,078
  • 7
  • 62
  • 99
0
votes
1 answer

python fabric: prevent already installed packages from being installed again

So writing a fabfile function, I attempt to automate the setup of a particular mac os x machine like this. from fabric.api import local, env, sudo, require def mac_port_setup(): PACKAGES = ['vim +python27', 'htop'] for item in PACKAGES: …
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
0
votes
2 answers

rsync copies local file structure onto remote box

I'm trying to upload a .zip file to a location on a remote server. In my fabfile.py I have this line: local("rsync files.zip webfaction:~/webapps/app") This completes without a problem. However when I ssh onto the box, I find that rsync put the…
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
-1
votes
1 answer

How to start celerycam with fabric in background

I use this command sudo('/usr/bin/python /project/manage.py celerycam &') and it's seem not to work fine. It does not run celerycam on the server that fabric completed its task.
vernomcrp
  • 3,459
  • 11
  • 34
  • 44
-1
votes
0 answers

Geckolib Model Not Animating

I have a geckolib model with animations and all made in blockbench, ive imported it into minecraft and the entity is loading and spawned in-game. however absolutely NO custom animations play at all.. ever. I've looked at in-built examples and copied…
1 2 3
99
100