Skip to content

Commit 780fe5d

Browse files
committed
Blacken action tools
1 parent 3ec4457 commit 780fe5d

3 files changed

Lines changed: 21 additions & 24 deletions

File tree

qubesadmin/tools/qvm_kill.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# You should have received a copy of the GNU Lesser General Public License along
1919
# with this program; if not, see <http://www.gnu.org/licenses/>.
2020

21-
'''Immediately terminate a qube without a graceful shutdown sequence.'''
21+
"""Immediately terminate a qube without a graceful shutdown sequence."""
2222

2323

2424
import asyncio
@@ -28,9 +28,10 @@
2828
from qubesadmin.utils.kill import kill
2929

3030
parser = QubesArgumentParser(
31-
description='immediately terminate a qube without a graceful shutdown'
32-
' sequence',
33-
vmname_nargs='+')
31+
description="immediately terminate a qube without a graceful shutdown"
32+
" sequence",
33+
vmname_nargs="+",
34+
)
3435

3536

3637
async def run_async(args=None, app=None):
@@ -49,5 +50,5 @@ def main(args=None, app=None):
4950
return asyncio.run(run_async(args=args, app=app))
5051

5152

52-
if __name__ == '__main__':
53+
if __name__ == "__main__":
5354
sys.exit(main())

qubesadmin/tools/qvm_pause.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# You should have received a copy of the GNU Lesser General Public License along
1919
# with this program; if not, see <http://www.gnu.org/licenses/>.
2020

21-
'''qvm-pause - Pause a domain'''
21+
"""qvm-pause - Pause a domain"""
2222

2323
import asyncio
2424
import sys
@@ -28,9 +28,11 @@
2828
from qubesadmin.utils.suspend import suspend
2929

3030

31-
parser = QubesArgumentParser(vmname_nargs='+',
32-
description='pause a qube',
33-
epilog='Paused qubes will be killed on system shutdown.')
31+
parser = QubesArgumentParser(
32+
vmname_nargs="+",
33+
description="pause a qube",
34+
epilog="Paused qubes will be killed on system shutdown.",
35+
)
3436

3537
parser.add_argument(
3638
"--suspend",
@@ -41,11 +43,11 @@
4143

4244

4345
def main(args=None, app=None):
44-
'''Main routine of :program:`qvm-pause`.
46+
"""Main routine of :program:`qvm-pause`.
4547
4648
:param list args: Optional arguments to override those delivered from \
4749
command line.
48-
'''
50+
"""
4951

5052
args = parser.parse_args(args, app=app)
5153
exit_code = 0
@@ -63,5 +65,5 @@ def main(args=None, app=None):
6365
return exit_code
6466

6567

66-
if __name__ == '__main__':
68+
if __name__ == "__main__":
6769
sys.exit(main())

qubesadmin/tools/qvm_unpause.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# You should have received a copy of the GNU Lesser General Public License along
1919
# with this program; if not, see <http://www.gnu.org/licenses/>.
2020

21-
'''qvm-unpause - Unpause a domain'''
21+
"""qvm-unpause - Unpause a domain"""
2222

2323
import asyncio
2424
import sys
@@ -27,27 +27,21 @@
2727
from qubesadmin.utils.unpause import unpause
2828

2929

30-
parser = QubesArgumentParser(
31-
vmname_nargs='+',
32-
description='unpause a domain')
30+
parser = QubesArgumentParser(vmname_nargs="+", description="unpause a domain")
3331

3432

3533
def main(args=None, app=None):
36-
'''Main routine of :program:`qvm-unpause`.
34+
"""Main routine of :program:`qvm-unpause`.
3735
3836
:param list args: Optional arguments to override those delivered from \
3937
command line.
40-
'''
38+
"""
4139

4240
args = parser.parse_args(args, app=app)
4341
exit_code = 0
4442
domains = args.domains
4543
if args.all_domains:
46-
domains = [
47-
vm
48-
for vm in domains
49-
if not vm.features.get("internal")
50-
]
44+
domains = [vm for vm in domains if not vm.features.get("internal")]
5145

5246
failed = asyncio.run(unpause(domains=domains))
5347
action = "unpause/resume"
@@ -59,5 +53,5 @@ def main(args=None, app=None):
5953
return exit_code
6054

6155

62-
if __name__ == '__main__':
56+
if __name__ == "__main__":
6357
sys.exit(main())

0 commit comments

Comments
 (0)