From facd819828376517c956aadc507b7e41997c29a1 Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Fri, 1 Sep 2023 10:36:14 +0200 Subject: [PATCH] Cleanup --- swan-cern/files/swan_config_cern.py | 5 ----- swan-cern/files/swan_spark_config.py | 8 +------- swan/files/swan_config.py | 3 +-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/swan-cern/files/swan_config_cern.py b/swan-cern/files/swan_config_cern.py index b1599fb..ca78b3f 100644 --- a/swan-cern/files/swan_config_cern.py +++ b/swan-cern/files/swan_config_cern.py @@ -1,7 +1,5 @@ import os, subprocess -import asyncio - from kubernetes_asyncio.client.models import ( V1EmptyDirVolumeSource, V1EnvVar, @@ -11,10 +9,8 @@ V1KeyToPath, V1ObjectFieldSelector, V1ObjectMeta, - V1PodSecurityContext, V1Secret, V1SecretVolumeSource, - V1SELinuxOptions, V1Volume, V1VolumeMount, ) @@ -46,7 +42,6 @@ async def get_swan_user_pod(self): async def _init_eos_secret(self): username = self.spawner.user.name - user_uid = self.spawner.user_uid eos_secret_name ='eos-tokens-%s' % username try: diff --git a/swan-cern/files/swan_spark_config.py b/swan-cern/files/swan_spark_config.py index 4d29a52..f52a8c9 100644 --- a/swan-cern/files/swan_spark_config.py +++ b/swan-cern/files/swan_spark_config.py @@ -1,4 +1,4 @@ -import os, subprocess, time, pwd, jwt +import subprocess from kubernetes_asyncio.client.models import ( V1EnvVar, @@ -17,8 +17,6 @@ from kubernetes_asyncio.client.rest import ApiException -import swanspawner - """ Class handling KubeSpawner.modify_pod_hook(spawner,pod) call """ @@ -116,10 +114,6 @@ def _init_spark_containers(self, hadoop_secret_name): """ notebook_container = self._get_pod_container('notebook') side_container = self._get_pod_container('side-container') - username = self.spawner.user.name - - pod_spec_containers = [] - side_container_volume_mounts = [] if hadoop_secret_name: # pod volume to mount generated hadoop tokens and diff --git a/swan/files/swan_config.py b/swan/files/swan_config.py index 5530d48..6b8f249 100644 --- a/swan/files/swan_config.py +++ b/swan/files/swan_config.py @@ -1,8 +1,7 @@ -import logging, os, subprocess +import logging from kubernetes_asyncio.client.models import ( V1EmptyDirVolumeSource, - V1EnvVar, V1HostPathVolumeSource, V1PersistentVolumeClaimVolumeSource, V1Volume,