mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
some fix
This commit is contained in:
+1
-1
@@ -4,5 +4,5 @@ WORKDIR /config
|
||||
RUN pip3 install --no-cache-dir -r /psa_car_controller/requirements.txt
|
||||
EXPOSE 5000
|
||||
RUN chmod +x /psa_car_controller/docker_files/init.sh
|
||||
ENV PSACC_BASE_PATH=/ PSACC_PORT=5000 PSACC_OPTIONS="-c -r -d --web-conf" PSACC_CONFIG_DIR="/config"
|
||||
ENV PSACC_BASE_PATH=/ PSACC_PORT=5000 PSACC_OPTIONS="-c -r --web-conf" PSACC_CONFIG_DIR="/config"
|
||||
CMD /psa_car_controller/docker_files/init.sh
|
||||
|
||||
+5
-1
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import traceback
|
||||
from urllib import request
|
||||
@@ -13,6 +14,7 @@ from cryptography.hazmat.backends import default_backend
|
||||
|
||||
from charge_control import ChargeControl, ChargeControls
|
||||
from my_psacc import MyPSACC
|
||||
from mylogger import logger
|
||||
|
||||
BRAND = {"com.psa.mym.myopel": {"realm": "clientsB2COpel", "brand_code": "OP", "app_name": "MyOpel"},
|
||||
"com.psa.mym.mypeugeot": {"realm": "clientsB2CPeugeot", "brand_code": "AP", "app_name": "MyPeugeot"},
|
||||
@@ -54,6 +56,8 @@ def firstLaunchConfig(package_name, client_email, client_password, country_code,
|
||||
REMOTE_REFRESH_TOKEN = None
|
||||
## Get Customer id
|
||||
site_code = BRAND[package_name]["brand_code"] + "_" + country_code + "_ESP"
|
||||
pfx_cert = a.get_file("assets/MWPMYMA1.pfx")
|
||||
save_key_to_pem(pfx_cert, "")
|
||||
try:
|
||||
res = requests.post(HOST_BRANDID_PROD + "/GetAccessToken",
|
||||
headers={
|
||||
@@ -77,7 +81,6 @@ def firstLaunchConfig(package_name, client_email, client_password, country_code,
|
||||
except:
|
||||
pass
|
||||
raise Exception(msg)
|
||||
|
||||
try:
|
||||
res2 = requests.post(
|
||||
f"https://mw-{BRAND[package_name]['brand_code'].lower()}-m2c.mym.awsmpsa.com/api/v1/"
|
||||
@@ -102,6 +105,7 @@ def firstLaunchConfig(package_name, client_email, client_password, country_code,
|
||||
msg += res2.text
|
||||
except:
|
||||
pass
|
||||
logging.error(msg)
|
||||
Exception(msg)
|
||||
|
||||
# Psacc
|
||||
|
||||
Reference in New Issue
Block a user