Commit graph

24 commits

Author SHA1 Message Date
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
b067ada15e Introduce some awesome signal handling
We can now press Ctrl+C remotely  while any subprocess of the bootstrapping process is running,
previously SIGINTs weren't propagated to the bootstrapping process because there was a thread
in between it all. Now the bootstrapping process is in it's own process group.
2015-04-16 22:21:45 +02:00
Anders Ingemann
ac7e32d35e Preserve stacktraces when reraising exceptions 2015-04-16 22:21:43 +02:00
Anders Ingemann
ab18516f79 Support SIGINT over the network 2015-04-16 22:15:20 +02:00
Anders Ingemann
c5bc45218e Fix documentation 2015-04-16 22:15:19 +02:00
Anders Ingemann
0f4c08e51d Refactor, logging, comments 2015-04-16 22:15:18 +02:00
Anders Ingemann
fd07954764 Remove manual deserialization 2015-04-16 22:15:18 +02:00
Anders Ingemann
569e1246a5 Deserialize manifest 2015-04-16 22:15:17 +02:00
Anders Ingemann
150b15bb4f (g|s)etstate for manifest 2015-04-16 22:15:17 +02:00
Anders Ingemann
e271f3e49a Initial work on integration testing started.
The work consists of three parts:
* Allow for bootstrapping remotely,
  this makes it possible to run the tests
  on e.g. OSX with VirtualBox installed
* Make bootstrapping a fully automated process
  where the manifests can be generated by the tests
  and the tests can call the bootstrapper directly in python
* Create a framework wherein instances can be booted up
  using the bootstrapped images and subsequently tested
2015-04-16 22:15:17 +02:00
Filipe Brandenburger
1fe10207b8 Check the value of the --color argument
Make sure it's either `auto' (the default), `always' or `never'. If it
does not match any of the values, raise a Docopt exception that causes
it to print usage and exit.

Tested:
- $ sudo ./bootstrap-vz --color=invalid manifests/gce.manifest.yml
  Value of --color must be one of auto, always or never.
  Usage: bootstrap-vz [options] MANIFEST

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-08-24 10:52:08 -07:00
Filipe Brandenburger
84cf497c66 Support --color option to indicate whether to use colors in the terminal
Mimic the behavior of the --color=<auto|always|never> found in tools
like `ls' and `grep'. Default to `auto' which checks whether stderr is a
tty to define whether colors are used.

Tested:
- Ran ./boostrap-vz --color=never and --color=always, confirmed
  colorization worked as expected.
- Ran ./boostrap-vz --color=auto ${manifest_file} 2>bootstrap.log,
  confirmed colors were not added to boostrap.log by default, repeated
  the test with --color=always and confirmed escape sequences were
  output.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-08-22 11:46:19 -07:00
Anders Ingemann
cca31b642f Add documentation for the run() function.
Also: Move the return statement in run() to the bottom
2014-07-09 23:31:16 +02:00
Anders Ingemann
0cc26d82d0 Allow passing data into the manifest.
This makes it possible to create dynamically created manifests
2014-07-09 23:17:05 +02:00
Anders Ingemann
7fe9c1ba36 Refactor logging setup to be more modular 2014-07-09 23:17:05 +02:00
Tomasz Rybak
869d7d770c Return information about created image. 2014-06-30 20:02:50 +02:00
Anders Ingemann
02c683120a Refactor tasklist for easier integration by taskoverview 2014-05-10 17:28:31 +02:00
Anders Ingemann
ee3fe0bf42 Convert param docs into parseable format. 2014-05-04 19:31:53 +02:00
Anders Ingemann
0a2cd86b4b Add get_standard_rollback_tasks()
This simplifies the the providser rollback_tasks fn considerably
2014-05-03 16:13:49 +02:00
Anders Ingemann
2017806d1f Switch to docopt for options parsing
Add option to not log to any file.
2014-04-08 21:26:15 +02:00
Anders Ingemann
bb680b28c5 Re-raise the catched exception after rollback 2014-04-07 21:47:05 +02:00
Anders Ingemann
ef1ab7692a Move import statement 2014-04-07 21:46:46 +02:00
Anders Ingemann
33a430566b bootstrap-vz is now a proper python package
logs/ was remove. logs are now placed in /var/logs/bootstrap-vz instead
2014-04-02 23:25:50 +02:00
Anders Ingemann
be96e4c13f Move code into proper package folder 2014-04-02 21:26:13 +02:00
Renamed from base/main.py (Browse further)