Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ flake8: requirements .flake8

$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "setuptools==$(SETUPTOOLS_VERSION)"
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install -r requirements.txt

$(VIRTUALENV_ST2CLIENT_DIR)/bin/activate; cd st2client ; ../$(VIRTUALENV_ST2CLIENT_DIR)/bin/python setup.py install ; cd ..
$(VIRTUALENV_ST2CLIENT_DIR)/bin/st2 --version
Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/action_chain_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/announcement_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/http_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/inquirer_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/local_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/noop_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/orquesta_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/python_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/remote_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions contrib/runners/winrm_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions scripts/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2actions/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2api/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2auth/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2client/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2common/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2reactor/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
24 changes: 23 additions & 1 deletion st2reactor/tests/integration/test_sensor_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ def setUpClass(cls):
def setUp(self):
super().setUp()
# pre-condition: Make sure there is no test pollution
# Delete any leftover queues from previous failed test runs
self._delete_sensor_watcher_amqp_queues(queue_name="st2.sensor.watch.covfefe")

# Verify queues are deleted
sw_queues = self._get_sensor_watcher_amqp_queues(
queue_name="st2.sensor.watch.covfefe"
)
# TODO: Maybe just delete any leftover queues from previous failed test runs.
self.assertTrue(len(sw_queues) == 0)

def test_sensor_watch_queue_gets_deleted_on_stop(self):
Expand Down Expand Up @@ -82,3 +85,22 @@ def _list_amqp_queues():
def _get_sensor_watcher_amqp_queues(self, queue_name):
all_queues = self._list_amqp_queues()
return set([q_name for q_name in all_queues if queue_name in q_name])

def _delete_sensor_watcher_amqp_queues(self, queue_name):
"""
Delete all queues containing the specified queue_name pattern.

:param string queue_name: Pattern to match in queue names
:returns: None
"""
# Get all queues matching the pattern
queues_to_delete = self._get_sensor_watcher_amqp_queues(queue_name=queue_name)

if not queues_to_delete:
return

# Create a rabbit client and delete each queue
rabbit_client = Client("localhost:15672", "guest", "guest")
for queue in queues_to_delete:
# Use default vhost "/"
rabbit_client.delete_queue("/", queue)
7 changes: 1 addition & 6 deletions st2stream/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
7 changes: 1 addition & 6 deletions st2tests/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
# for subpackages.
# At the very least we can vendorize some of their code instead of reimplementing
# each piece of their code every time our parsing breaks.
PY3 = sys.version_info[0] == 3

if PY3:
text_type = str
else:
text_type = unicode # noqa # pylint: disable=E0602
text_type = str

GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

Expand Down
Loading