Commit graph

11 commits

Author SHA1 Message Date
Andrew Bogott
43b321ce91 Replace a bunch of \\ escapes with raw strings
There are a few cases where changing to a raw string
will change the behavior; I'll address that in a later patch.
2019-03-05 20:05:59 +00:00
Andrew Bogott
b9dda552db flake8: resolve W605 'invalid escape sequence' warnings
This patch scares me since every fix involves adding a character
to a regex.  I am /pretty sure/ that this is a no-op but I don't
have the capacity to test this beyond what tox can do.
2019-03-05 19:01:05 +00:00
Carlos Meza
c068ba07ab pylint len-as-condition 2018-02-19 00:31:12 -08:00
Carlos Meza
b47b55172b pylint import-error bug workaround for distutils 2018-02-19 00:30:20 -08:00
Brendan Harley
acb17a98d0 Add executable check to find_executable
Find_executable returns a file in the path, so it must be checked for
executability.
2017-07-02 17:16:25 +02:00
Brendan Harley
df3a200df3 Fix unfailing CheckExternalCommands
On Unix, with shell=True, the shell default to /bin/sh.
Using Popen(['type', command], shell=True) is equivalent to calling
Popen(['/bin/sh', '-c', 'type', command]).
In this case 'command' becomes a positional parameter to the shell,
and not an argument to the command 'type'.

The solution is to pass a single string as parameter.

The problem is that with shell=True, we are never safe from a shell injection,
so it is wiser to use a python only solution.

The package distutils is part of the standard distribution, so it doesn't add
extra dependencies.
The method find_executable has the same behaviour as 'which' on bash.
2017-05-31 22:28:04 +02:00
Nicolas Braud-Santoni
9bf2c45ee2
Moving checking tasks to the validation phase 2016-09-12 00:52:10 +02:00
Anders Ingemann
bb41ba68dd Tiny fix for CheckExternalCommands 2016-06-05 10:45:19 +02:00
Anders Ingemann
f62c8ade99 Convert indentation from tabs to spaces (4)
Up until now I didn't see the point of using spaces for indentation.
However, the previous commit (a18bec3) was quite eye opening.
Given that python is an indentation aware language, the amount of
mistakes that went unnoticed because tabs and spaces were used
at the same time (tabs for indentation and spaces for alignment)
were unacceptable.

E101,W191 have been re-enable in the tox flake8 checker and
the documentation has been modified accordingly.

The following files have been left as-is:
* bootstrapvz/common/assets/extlinux/extlinux.conf
* bootstrapvz/common/assets/init.d/expand-root
* bootstrapvz/common/assets/init.d/generate-ssh-hostkeys
* bootstrapvz/common/assets/init.d/squeeze/generate-ssh-hostkeys
* bootstrapvz/plugins/docker_daemon/assets/init.d/docker
* bootstrapvz/providers/ec2/assets/bin/growpart
* bootstrapvz/providers/ec2/assets/grub.d/40_custom
* bootstrapvz/providers/ec2/assets/init.d/ec2-get-credentials
* bootstrapvz/providers/ec2/assets/init.d/ec2-run-user-data
* docs/_static/taskoverview.coffee
* docs/_static/taskoverview.less
* tests/unit/subprocess.sh
2016-06-04 11:38:16 +02:00
Anders Ingemann
bbb06d717e Properly fix imports and make bootstrapvz work like a package 2014-04-02 21:32:10 +02:00
Anders Ingemann
be96e4c13f Move code into proper package folder 2014-04-02 21:26:13 +02:00
Renamed from common/tasks/host.py (Browse further)