Skip to content

Commit

Permalink
Fix pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Sep 18, 2024
1 parent 6dad995 commit c6fd36e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion wrapanapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Imports for convenience
from .entities.vm import VmState
from .systems.container.rhopenshift import Openshift
from .systems.container.podman import Podman
from .systems.container.rhopenshift import Openshift
from .systems.ec2 import EC2System
from .systems.google import GoogleCloudSystem
from .systems.hawkular import HawkularSystem
Expand Down
2 changes: 1 addition & 1 deletion wrapanapi/systems/container/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .rhopenshift import Openshift
from .podman import Podman
from .rhopenshift import Openshift

__all__ = ["Openshift", "Podman"]
13 changes: 4 additions & 9 deletions wrapanapi/systems/container/podman.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
from abc import ABCMeta
from datetime import datetime

from podman import PodmanClient
from proto.utils import cached_property
from datetime import datetime

from wrapanapi.systems.base import System
from wrapanapi.entities.base import Entity
from abc import ABCMeta
from wrapanapi.systems.base import System


class PodmanContainer(Entity, metaclass=ABCMeta):

def __init__(self, system, raw=None, **kwargs):
"""
Constructor for an PodmanContainer tied to a specific host.
Expand Down Expand Up @@ -45,7 +43,7 @@ def uuid(self):

@property
def creation_time(self):
return datetime.fromisoformat(self.raw.attrs['Created'])
return datetime.fromisoformat(self.raw.attrs["Created"])

def delete(self, force=False):
return self.raw.remove(force=force)
Expand All @@ -63,7 +61,6 @@ def refresh(self):


class Podman(System):

def __init__(
self, hostname, username, protocol="http+ssh", port=22, verify_ssl=False, **kwargs
):
Expand Down Expand Up @@ -105,9 +102,7 @@ def containers(self):
"""Returns list of containers"""
conInstance = []
for cont in self.containers_collection.list():
conInstance.append(
PodmanContainer(system=self, name=cont.name, id=cont.id, raw=cont)
)
conInstance.append(PodmanContainer(system=self, name=cont.name, id=cont.id, raw=cont))
return conInstance

def get_container(self, key):
Expand Down

0 comments on commit c6fd36e

Please sign in to comment.