forked from Chaosthebot/Chaos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
57 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
*.bak | ||
*.pyc | ||
.DS_Store | ||
.venv | ||
*.pyo | ||
*.secret | ||
*.swp | ||
*.tmp | ||
*~ | ||
.DS_Store | ||
.vagrant/ | ||
.venv | ||
__pycache__ | ||
github_pat.secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
# Opening a PR | ||
Once you open a pull request, ChaosBot will give it X seconds (where X is | ||
determined by github\_api.voting.get\_voting\_window) | ||
before collecting votes. During this time, you should let people know about | ||
your contribution, so that they may vote for it and ensure your hard work gets | ||
merged in. If you do not wish for ChaosBot to consider your PR for merging just | ||
yet, add "WIP" somewhere in your PR title. Remove it when you're ready for voting. | ||
|
||
Once you open a pull request, ChaosBot will give it X seconds (where X is determined by github\_api.voting.get\_voting\_window) before collecting votes. During this time, you should let people know about your contribution, so that they may vote for it and ensure your hard work gets merged in. If you do not wish for ChaosBot to consider your PR for merging just yet, add "WIP" somewhere in your PR title. Remove it when you're ready for voting. | ||
|
||
# Changing your PR | ||
You may change your PR at any time without losing votes, but keep in mind, any | ||
new changes will reset the vote window for additional time. | ||
|
||
You may change your PR at any time without losing votes, but keep in mind, any new changes will reset the vote window for additional time. | ||
|
||
# Merging your PR | ||
At the end of the voting window, ChaosBot will review the votes, and if your PR | ||
crosses a threshold, your changes will be merged in. To thank you for your merged | ||
contribution, ChaosBot will then follow you on GitHub. If your changes are not | ||
merged in, take the time to consider the feedback you received, and create a new | ||
PR with changes you believe people will be willing to vote for. | ||
|
||
At the end of the voting window, ChaosBot will review the votes, and if your PR crosses a threshold, your changes will be merged in. To thank you for your merged contribution, ChaosBot will then follow you on GitHub. If your changes are not merged in, take the time to consider the feedback you received, and create a new PR with changes you believe people will be willing to vote for. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
From python:onbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import http.server | ||
import socketserver | ||
import socket | ||
|
||
# set the process name to "chaos_server" so we can easily kill it with | ||
# "pkill chaos_server" | ||
|
||
|
||
def set_proc_name(newname): | ||
"""Change the process name using libc.so.6""" | ||
from ctypes import cdll, byref, create_string_buffer | ||
libc = cdll.LoadLibrary('libc.so.6') | ||
buff = create_string_buffer(len(newname) + 1) | ||
buff.value = newname.encode("ascii") | ||
libc.prctl(15, byref(buff), 0, 0, 0) | ||
|
||
|
||
set_proc_name("chaos_server") | ||
|
||
# start server on port 80 | ||
PORT = 80 | ||
Handler = http.server.SimpleHTTPRequestHandler | ||
|
||
|
||
class NoTimeWaitTCPServer(socketserver.ThreadingTCPServer): | ||
""" when a socket does is shutdown dance, it ends up in a TIME-WAIT state, | ||
which can prevent rebinding on it quickly. here we say "shut up, socket", | ||
let me rebind anyways even if you're in TIME-WAIT." that will teach it. """ | ||
"""When a socket does is shutdown dance, it ends up in a TIME-WAIT state, | ||
which can prevent rebinding on it quickly. Here we say "shut up, socket", | ||
let me rebind anyways even if you're in TIME-WAIT." That will teach it.""" | ||
|
||
def server_bind(self): | ||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
self.socket.bind(self.server_address) | ||
|
||
|
||
httpd = NoTimeWaitTCPServer(("", PORT), Handler) | ||
httpd.serve_forever() | ||
def main(): | ||
# set the process name to "chaos_server" so we can easily kill it with: | ||
# pkill chaos_server | ||
set_proc_name("chaos_server") | ||
|
||
port = 80 | ||
handler = http.server.SimpleHTTPRequestHandler | ||
httpd = NoTimeWaitTCPServer(("", port), handler) | ||
|
||
# serve HTTP on port 80 | ||
httpd.serve_forever() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/bin/bash | ||
|
||
#!/bin/sh | ||
cd puppet | ||
puppet apply --verbose --modulepath=$PWD/modules/ $PWD/manifests/ | ||
puppet apply --verbose --modulepath="$PWD/modules/" "$PWD/manifests/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
#!/bin/bash | ||
cd "$(dirname "$0")" | ||
|
||
for file in startup.d/*; do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import json | ||
import os | ||
import logging | ||
|