Changes

Jump to: navigation, search

OPS435 Python Lab 8

5 bytes added, 13:02, 30 December 2017
Deploy a website
There is something weird in the code above that you haven't seen before but it's required for some uses of Fabric: the '''with''' statement.
The problem is that separate '''run''' commands each execute in a brand new session, each with its own shell. They are not like separate lines in a single shell script even though they look like they should be.
That means if you run a cd command and then a tar command separately - the tar command will not run in the directory where you think it will. In order to fix this you have to nest commands inside a '''with''' - it's like a '''run''' but with persistant results.

Navigation menu