Skip to content

Commit ae3e321

Browse files
authored
fix black warnings; update for yaml issue; bump version; add 3.9 to ci (#268)
* fix black warnings; update for yaml issue; add 3.9 to ci * match the versions in setup.py with the ci
1 parent 1f63780 commit ae3e321

7 files changed

Lines changed: 13 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- "3.6"
3737
- "3.7"
3838
- "3.8"
39+
- "3.9"
3940
steps:
4041
- name: Repository checkout
4142
uses: actions/checkout@v2

maas/client/errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ def __init__(self, msg, obj):
1010

1111

1212
class OperationNotAllowed(Exception):
13-
""" MAAS says this operation cannot be performed. """
13+
"""MAAS says this operation cannot be performed."""
1414

1515

1616
class ObjectNotLoaded(Exception):
17-
""" Object is not loaded. """
17+
"""Object is not loaded."""
1818

1919

2020
class CannotDelete(Exception):
21-
""" Object cannot be deleted. """
21+
"""Object cannot be deleted."""
2222

2323

2424
class PowerError(MAASException):

maas/client/flesh/tests/test_controllers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_returns_table_with_controllers(self):
7070
cmd = controllers.cmd_controllers(parser)
7171
subparser = controllers.cmd_controllers.register(parser)
7272
options = subparser.parse_args([])
73-
output = yaml.load(
73+
output = yaml.safe_load(
7474
cmd.execute(origin, options, target=tabular.RenderTarget.yaml)
7575
)
7676
self.assertEquals(

maas/client/flesh/tests/test_devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_returns_table_with_devices(self):
4949
cmd = devices.cmd_devices(parser)
5050
subparser = devices.cmd_devices.register(parser)
5151
options = subparser.parse_args([])
52-
output = yaml.load(
52+
output = yaml.safe_load(
5353
cmd.execute(origin, options, target=tabular.RenderTarget.yaml)
5454
)
5555
self.assertEquals(

maas/client/flesh/tests/test_nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_returns_table_with_nodes(self):
4848
cmd = nodes.cmd_nodes(parser)
4949
subparser = nodes.cmd_nodes.register(parser)
5050
options = subparser.parse_args([])
51-
output = yaml.load(
51+
output = yaml.safe_load(
5252
cmd.execute(origin, options, target=tabular.RenderTarget.yaml)
5353
)
5454
self.assertEquals(

maas/client/viscera/tests/test_sshkeys.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def make_origin():
1717

1818
class TestSSHKeys(TestCase):
1919
def test__sshkeys_create(self):
20-
""" SSHKeys.create() returns a new SSHKey. """
20+
"""SSHKeys.create() returns a new SSHKey."""
2121
SSHKeys = make_origin().SSHKeys
2222
key = make_string_without_spaces()
2323
SSHKeys._handler.create.return_value = {"id": 1, "key": key, "keysource": ""}
2424
SSHKeys.create(key=key)
2525
SSHKeys._handler.create.assert_called_once_with(key=key)
2626

2727
def test__sshkeys_read(self):
28-
""" SSHKeys.read() returns a list of SSH keys. """
28+
"""SSHKeys.read() returns a list of SSH keys."""
2929
SSHKeys = make_origin().SSHKeys
3030
keys = [
3131
{
@@ -42,7 +42,7 @@ def test__sshkeys_read(self):
4242

4343
class TestSSHKey(TestCase):
4444
def test__sshkey_read(self):
45-
""" SSHKeys.read() returns a single SSH key. """
45+
"""SSHKeys.read() returns a single SSH key."""
4646
SSHKey = make_origin().SSHKey
4747
key_id = random.randint(0, 100)
4848
key_dict = {"id": key_id, "key": make_string_without_spaces(), "keysource": ""}

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ def read(filename):
3434
'Intended Audience :: System Administrators',
3535
'License :: OSI Approved :: GNU Affero General Public License v3',
3636
'Programming Language :: Python :: 3 :: Only',
37-
'Programming Language :: Python :: 3.5',
3837
'Programming Language :: Python :: 3.6',
38+
'Programming Language :: Python :: 3.7',
39+
'Programming Language :: Python :: 3.8',
40+
'Programming Language :: Python :: 3.9',
3941
'Topic :: Software Development :: Libraries',
4042
],
4143
namespace_packages=['maas'],

0 commit comments

Comments
 (0)