Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Jan 22, 2016
1 parent 337d9a1 commit 17c26ee
Show file tree
Hide file tree
Showing 140 changed files with 409 additions and 450 deletions.
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- repo: https://github.com/pre-commit/pre-commit-hooks.git
sha: cf550fcab3f12015f8676b8278b30e1a5bc10e70
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: autopep8-wrapper
language_version: python2.7
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: debug-statements
- id: name-tests-test
args: [--django]
files: ^tests/.*\.py$
- id: requirements-txt-fixer
- id: flake8
exclude: ^docs/source/conf.py$
language_version: python2.7
- repo: https://github.com/asottile/reorder_python_imports.git
sha: 3d86483455ab5bd06cc1069fdd5ac57be5463f10
hooks:
- id: reorder-python-imports
language_version: python2.7
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@



\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -172,8 +172,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'paasta_tools.tex', u'service\\_deployment\\_tools Documentation',
u'Yelp Inc', 'manual'),
('index', 'paasta_tools.tex', u'service\\_deployment\\_tools Documentation',
u'Yelp Inc', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
1 change: 0 additions & 1 deletion general_itests/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import shutil

from docker import Client
Expand Down
13 changes: 7 additions & 6 deletions general_itests/steps/deployments_json_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import contextlib
import os
import shutil
import tempfile
from time import time

from behave import when, then, given
from dulwich.repo import Repo
import mock
from behave import given
from behave import then
from behave import when
from dulwich.objects import Blob
from dulwich.objects import Tree
from dulwich.objects import Commit
from dulwich.objects import parse_timezone
import mock
from time import time
from dulwich.objects import Tree
from dulwich.repo import Repo

from paasta_tools import generate_deployments_for_service
from paasta_tools import marathon_tools
Expand Down
5 changes: 3 additions & 2 deletions general_itests/steps/fsm_wizard_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import shutil
import tempfile

from behave import given, when, then
from behave import given
from behave import then
from behave import when
from service_configuration_lib import read_services_configuration

from paasta_tools.utils import _run
Expand Down
5 changes: 3 additions & 2 deletions general_itests/steps/local_run_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from behave import given, when, then
from behave import given
from behave import then
from behave import when
from path import Path

from paasta_tools.utils import _run
Expand Down
5 changes: 3 additions & 2 deletions general_itests/steps/paasta_execute_docker_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from behave import given, when, then
from behave import given
from behave import then
from behave import when
from docker import Client
from docker.errors import APIError

Expand Down
4 changes: 2 additions & 2 deletions general_itests/steps/run_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import signal

from behave import when, then
from behave import then
from behave import when

from paasta_tools.utils import _run

Expand Down
4 changes: 2 additions & 2 deletions general_itests/steps/tail_paasta_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import contextlib
import time

from behave import when, then
import mock
from behave import then
from behave import when

from paasta_tools.cli.cmds import logs

Expand Down
5 changes: 3 additions & 2 deletions general_itests/steps/validate_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from behave import given, when, then
from behave import given
from behave import then
from behave import when

from paasta_tools.cli.utils import x_mark
from paasta_tools.utils import _run
Expand Down
4 changes: 2 additions & 2 deletions paasta_itests/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import shutil
import time

from itest_utils import wait_for_marathon
from itest_utils import cleanup_file
from itest_utils import setup_mesos_cli_config
from itest_utils import wait_for_marathon

from paasta_tools import marathon_tools


Expand Down
1 change: 0 additions & 1 deletion paasta_itests/itest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import os
import time
Expand Down
10 changes: 6 additions & 4 deletions paasta_itests/steps/bounces_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import contextlib
import mock
import time

from behave import given, when, then
import mock
from behave import given
from behave import then
from behave import when

from paasta_tools import bounce_lib
from paasta_tools.bounce_lib import get_happy_tasks
from paasta_tools import drain_lib
from paasta_tools import marathon_tools
from paasta_tools import setup_marathon_job
from paasta_tools.bounce_lib import get_happy_tasks


def which_id(context, which):
Expand Down
4 changes: 2 additions & 2 deletions paasta_itests/steps/chronos_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from behave import when, then
from behave import then
from behave import when

from paasta_tools import chronos_tools

Expand Down
9 changes: 5 additions & 4 deletions paasta_itests/steps/cleanup_chronos_job_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json
from behave import when, then

from paasta_tools.utils import _run
from behave import then
from behave import when

from paasta_tools.chronos_tools import compose_job_id
from paasta_tools.utils import _run


@when(('I launch {num_jobs} {state} jobs for the service "{service}"'
' with scheduled chronos instance "{job}"'))
' with scheduled chronos instance "{job}"'))
def launch_jobs(context, num_jobs, state, service, job):
client = context.chronos_client
jobs = [{
Expand Down
8 changes: 5 additions & 3 deletions paasta_itests/steps/hacheck_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import time

from behave import given, when, then
import mock
import time
from behave import given
from behave import then
from behave import when
from itest_utils import get_service_connection_string

from paasta_tools import drain_lib
from itest_utils import get_service_connection_string


@given('a working hacheck container')
Expand Down
4 changes: 2 additions & 2 deletions paasta_itests/steps/marathon_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import time

from behave import when, then
import mock
from behave import then
from behave import when

import paasta_tools

Expand Down
8 changes: 4 additions & 4 deletions paasta_itests/steps/mesos_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import contextlib
import mock
from behave import when, then
import mesos.cli.master

import mesos.cli.master
import mock
from behave import then
from behave import when
from itest_utils import get_service_connection_string

from paasta_tools import check_mesos_resource_utilization
Expand Down
8 changes: 4 additions & 4 deletions paasta_itests/steps/paasta_metastatus_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from behave import when, then
from behave import then
from behave import when
from marathon import MarathonApp

from paasta_tools import marathon_tools
from paasta_tools.utils import _run
from paasta_tools.utils import remove_ansi_escape_sequences
from paasta_tools import marathon_tools
from marathon import MarathonApp


@when(u'all zookeepers are unavailable')
Expand Down
8 changes: 4 additions & 4 deletions paasta_itests/steps/paasta_serviceinit_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import time

from behave import when, then
import mock
from behave import then
from behave import when

import paasta_tools
from paasta_tools import marathon_serviceinit
Expand Down Expand Up @@ -84,7 +84,7 @@ def marathon_restart_gets_new_task_ids(context, job_id):


@then((u'paasta_serviceinit status for the service_instance "{service_instance}"'
' exits with return code 0 and the correct output'))
' exits with return code 0 and the correct output'))
def chronos_status_returns_healthy(context, service_instance):
cmd = '../paasta_tools/paasta_serviceinit.py --soa-dir %s %s status' % (context.soa_dir, service_instance)
print 'Running cmd %s' % cmd
Expand All @@ -98,7 +98,7 @@ def chronos_status_returns_healthy(context, service_instance):


@then((u'paasta_serviceinit status --verbose for the service_instance "{service_instance}"'
' exits with return code 0 and the correct output'))
' exits with return code 0 and the correct output'))
def chronos_status_verbose_returns_healthy(context, service_instance):
cmd = "../paasta_tools/paasta_serviceinit.py --soa-dir %s %s status --verbose" % (context.soa_dir, service_instance)
print 'Running cmd %s' % cmd
Expand Down
4 changes: 2 additions & 2 deletions paasta_itests/steps/setup_chronos_job_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import copy

from behave import when, then
from behave import then
from behave import when

from paasta_tools import chronos_tools
from paasta_tools.utils import _run
Expand Down
6 changes: 3 additions & 3 deletions paasta_itests/steps/setup_marathon_job_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import contextlib

from behave import when, then
import mock
from behave import then
from behave import when

from paasta_tools import setup_marathon_job
from paasta_tools import marathon_tools
from paasta_tools import setup_marathon_job

fake_service_name = 'fake_complete_service'
fake_cluster_name = 'fake_cluster'
Expand Down
Loading

0 comments on commit 17c26ee

Please sign in to comment.