Skip to content

Commit a0c560e

Browse files
fix bad name type
1 parent 82a66af commit a0c560e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

controllers/manager_controller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ def handle_desktop_GET( self, args ):
565565
raise cherrypy.HTTPError(status=400, message='Invalid parameters Bad Request')
566566
self.logger.debug(f'get ephemeralcontainer resources usage for {desktop_name} {container_name}')
567567
# get ephemeralcontainer resources usage
568-
# /API/manager/desktop/hermes-8a49ca1a-fcc6-4b7b-960f-5a27debd4773/container/container_id/resources_usage
568+
# /API/manager/desktop
569+
# /hermes-8a49ca1a-fcc6-4b7b-960f-5a27debd4773/container/container_id/resources_usage
569570
resource = oc.od.composer.get_container_resources_usage(desktop_name=desktop_name, container_name=container_name)
570571
return resource
571572
# /API/manager/desktop/hermes-8a49ca1a-fcc6-4b7b-960f-5a27debd4773/container/container_id/resources_usage

oc/od/orchestrator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5684,8 +5684,10 @@ def get_resources_usage(self, authinfo:AuthInfo, userinfo:AuthUser, pod_name:str
56845684
if isinstance( myPodList, V1PodList ) and len(myPodList.items) > 0 :
56855685
# take only the first one, there is only one
56865686
myPod = myPodList.items[0]
5687-
container_name = self.orchestrator.getfirstcontainerfromPod( myPod )
5688-
resources_usage = super().get_resources_usage( myPod=myPod, container_name=container_name)
5687+
firstcontainer = self.orchestrator.getfirstcontainerfromPod( myPod )
5688+
if isinstance( firstcontainer, V1Container ):
5689+
container_name = firstcontainer.name
5690+
resources_usage = super().get_resources_usage( myPod=myPod, container_name=container_name)
56895691
return resources_usage
56905692

56915693
def list_and_stop( self, authinfo:AuthInfo, userinfo:AuthUser, pod_name:str )->bool:

0 commit comments

Comments
 (0)