Skip to content

Commit

Permalink
fix: make format
Browse files Browse the repository at this point in the history
  • Loading branch information
曲源成 committed Aug 22, 2023
1 parent 178fdb9 commit 74f7171
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 32 deletions.
17 changes: 2 additions & 15 deletions console/repositories/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from console.repositories.base import BaseConnection
from django.db import transaction
from docker_image import reference
from www.models.main import (ServiceWebhooks, TenantServiceInfo, TenantServiceInfoDelete, OpenApiDeployAppEvent)
from www.models.main import (ServiceWebhooks, TenantServiceInfo, TenantServiceInfoDelete)

logger = logging.getLogger('default')

Expand Down Expand Up @@ -502,19 +502,6 @@ def update_access_key(self, enterprise_id, name, access_key):
return AppMarket.objects.filter(enterprise_id=enterprise_id, name=name).update(access_key=access_key)


class DeployAppEvent(object):
def get_deploy_app_event(self, event_id):
event = OpenApiDeployAppEvent.objects.filter(event_id=event_id)
if not event:
raise ServiceHandleException(status_code=404, msg="no found event", msg_show="事件信息不存在")

def create_deploy_app_event(self, kwargs):
return OpenApiDeployAppEvent.objects.create(**kwargs)

def update_deploy_app_event(self, event_id, kwargs):
return OpenApiDeployAppEvent.objects.filter(event_id=event_id).update(**kwargs)


service_repo = TenantServiceInfoRepository()
service_source_repo = ServiceSourceRepository()
recycle_bin_repo = ServiceRecycleBinRepository()
Expand All @@ -523,4 +510,4 @@ def update_deploy_app_event(self, event_id, kwargs):
service_webhooks_repo = TenantServiceWebhooks()
app_tag_repo = AppTagRepository()
app_market_repo = AppMarketRepository()
deploy_app_event = DeployAppEvent()

12 changes: 1 addition & 11 deletions console/services/group_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from console.enum.app import GovernanceModeEnum, AppType
from console.exception.bcode import ErrUserNotFound, ErrApplicationNotFound, ErrK8sAppExists
from console.exception.main import AbortRequest, ServiceHandleException
from console.repositories.app import service_repo, service_source_repo, deploy_app_event
from console.repositories.app import service_repo, service_source_repo
from console.repositories.app_config import (domain_repo, env_var_repo, port_repo, tcp_domain, dep_relation_repo)
from console.repositories.app_config_group import app_config_group_repo
from console.repositories.backup_repo import backup_record_repo
Expand Down Expand Up @@ -926,14 +926,4 @@ def get_watch_managed_data(self, tenant, region_name, app_id):
}
return data

def get_deploy_app_event(self, event_id):
return deploy_app_event.get_deploy_app_event(event_id=event_id)

def create_deploy_app_event(self, kwargs):
return deploy_app_event.create_deploy_app_event(kwargs=kwargs)

def update_deploy_app_event(self, event_id, kwargs):
return deploy_app_event.update_deploy_app_event(event_id=event_id, kwargs=kwargs)


group_service = GroupService()
2 changes: 1 addition & 1 deletion console/services/region_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def conver_region_info(self, region, check_status, level="open"):
enterprise_id=region.enterprise_id, region=region.region_name)
region_services_status = region_repo.get_service_status_count_by_region_name(region)
res, body = region_api.get_region_resources(region.enterprise_id, region=region.region_name)
rbd_version = ""
rbd_version = rbd_version["raw"]
if res.get("status") == 200:
region_resource["total_memory"] = body["bean"]["cap_mem"]
region_resource["used_memory"] = body["bean"]["req_mem"]
Expand Down
5 changes: 0 additions & 5 deletions openapi/services/component_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,4 @@ def component_build(self, tenant: Tenants, component: TenantServiceInfo, user: U
raise ServiceHandleException(msg=message, msg_show=message, status_code=code)


class DeployApp(object):
def deploy_app_by_ram(self):
return


component_action_service = ComponnetActionService()

0 comments on commit 74f7171

Please sign in to comment.