1

Is there a way to tell fabric to just print the commands it will execute instead of actually execute them?

I'm preparing an installation script and if it fails I'll have to uninstall the steps previous to error occurrence.

I've checked the "fab" command parameters but found nothing about this.

Thank you for your help.

4

1 回答 1

2

There are tickets (including issue 26) open on github that request such a feature. The challenge described in that thread is that you can't always be certain what the script would do - ie/ some behaviour may change depending on the state of the remote server.

As an alternative, you could look at reproducing your environment in a virtual machine (vagrant makes doing this really easy), and testing to see whether your scripts run as expected there.

If you're really concerned about this, a configuration management system (particularly one that can reverse changes) like puppet or chef may make more sense.

于 2013-03-31T01:52:04.800 回答