Skip to content

Commit dae0525

Browse files
authored
Merge pull request #17 from MatthiasWinzeler/align-file-headers
align headers, clean up imports & fix typo
2 parents 3dda10c + 4dd8602 commit dae0525

10 files changed

+13
-29
lines changed

plugins/module_utils/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
URL_SERVICE_INCIDENT = 'https://launchpad.support.sap.com/services/odata/incidentws'
77
URL_SERVICE_USER_ADMIN = 'https://launchpad.support.sap.com/services/odata/useradminsrv'
88
URL_SOFTWARE_DOWNLOAD = 'https://softwaredownloads.sap.com'
9+
# Maintenance Planner
10+
URL_MAINTENANCE_PLANNER = 'https://maintenanceplanner.cfapps.eu10.hana.ondemand.com'
911
URL_SYSTEMS_PROVISIONING = 'https://launchpad.support.sap.com/services/odata/i7p/odata/bkey'
10-
# Maintainance Planner
11-
URL_MAINTAINANCE_PLANNER = 'https://maintenanceplanner.cfapps.eu10.hana.ondemand.com'
1212
URL_USERAPPS = 'https://userapps.support.sap.com/sap/support/mp/index.html'
1313
URL_USERAPP_MP_SERVICE = 'https://userapps.support.sap.com/sap/support/mnp/services'
1414
URL_LEGACY_MP_API = 'https://tech.support.sap.com/sap/support/mnp/services'

plugins/module_utils/sap_api_common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env python3
2-
# coding: utf-8
3-
41
import logging
52
import re
63
from urllib.parse import urlparse

plugins/module_utils/sap_id_sso.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env python3
2-
# coding: utf-8
3-
41
import json
52
import logging
63
import re

plugins/module_utils/sap_launchpad_maintenance_planner_runner.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#!/user/bin/env python3
2-
# coding: utf-8
3-
4-
import os
51
import pathlib
62
import re
73
import time
@@ -11,11 +7,10 @@
117
from bs4 import BeautifulSoup
128
from lxml import etree
139
from requests.auth import HTTPBasicAuth
14-
from requests.sessions import session
1510

1611
from . import constants as C
1712
from .sap_api_common import _request, https_session
18-
from .sap_id_sso import _get_sso_endpoint_meta, sap_sso_login
13+
from .sap_id_sso import _get_sso_endpoint_meta
1914

2015
_MP_XSRF_TOKEN = None
2116
_MP_TRANSACTIONS = None
@@ -24,7 +19,7 @@
2419
def auth_maintenance_planner():
2520
# Clear mp relevant cookies for avoiding unexpected responses.
2621
_clear_mp_cookies('maintenanceplanner')
27-
res = _request(C.URL_MAINTAINANCE_PLANNER)
22+
res = _request(C.URL_MAINTENANCE_PLANNER)
2823
sig_re = re.compile('signature=(.*?);path=\/";location="(.*)"')
2924
signature, redirect = re.search(sig_re, res.text).groups()
3025

@@ -35,7 +30,7 @@ def auth_maintenance_planner():
3530
'locationAfterLogin': '%2F'
3631
}
3732

38-
MP_DOMAIN = C.URL_MAINTAINANCE_PLANNER.replace('https://', '')
33+
MP_DOMAIN = C.URL_MAINTENANCE_PLANNER.replace('https://', '')
3934
for k, v in mp_cookies.items():
4035
https_session.cookies.set(k, v, domain=MP_DOMAIN, path='/')
4136

@@ -68,7 +63,7 @@ def auth_userapps():
6863

6964

7065
def get_mp_user_details():
71-
url = urljoin(C.URL_MAINTAINANCE_PLANNER,
66+
url = urljoin(C.URL_MAINTENANCE_PLANNER,
7267
'/MCP/MPHomePageController/getUserDetailsDisplay')
7368
params = {'_': int(time.time() * 1000)}
7469
user = _request(url, params=params).json()

plugins/module_utils/sap_launchpad_software_center_catalog_runner.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#!/user/bin/env python3
2-
# coding: utf-8
3-
41
from . import constants as C
52
from .sap_api_common import _request
6-
from .sap_id_sso import sap_sso_login
73

84

95
def get_software_catalog():

plugins/module_utils/sap_launchpad_software_center_download_runner.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/user/bin/env python3
2-
# coding: utf-8
3-
41
import hashlib
52
import json
63
import logging
@@ -12,7 +9,7 @@
129

1310
from . import constants as C
1411
from .sap_api_common import _request, https_session
15-
from .sap_id_sso import _get_sso_endpoint_meta, sap_sso_login
12+
from .sap_id_sso import _get_sso_endpoint_meta
1613

1714
logger = logging.getLogger(__name__)
1815

plugins/module_utils/sap_launchpad_software_center_download_search_fuzzy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from . import constants as C
77
from .sap_api_common import _request
8-
from .sap_id_sso import sap_sso_login
98

109

1110
def search_software_fuzzy(query, max=None, csv_filename=None):

plugins/modules/maintenance_planner_files.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22

33
# SAP Maintenance Planner files retrieval
44

@@ -69,6 +69,7 @@
6969
from ..module_utils.sap_launchpad_maintenance_planner_runner import *
7070
from ..module_utils.sap_launchpad_software_center_download_runner import \
7171
is_download_link_available
72+
from ..module_utils.sap_id_sso import sap_sso_login
7273

7374

7475
def run_module():

plugins/modules/maintenance_planner_stack_xml_download.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22

33
# SAP Maintenance Planner Stack XML download
44

@@ -69,6 +69,7 @@
6969

7070
# Import runner
7171
from ..module_utils.sap_launchpad_maintenance_planner_runner import *
72+
from ..module_utils.sap_id_sso import sap_sso_login
7273

7374

7475
def run_module():

plugins/modules/software_center_download.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22

33
# SAP software download module
44

@@ -88,6 +88,7 @@
8888

8989
# Import runner
9090
from ..module_utils.sap_launchpad_software_center_download_runner import *
91+
from ..module_utils.sap_id_sso import sap_sso_login
9192

9293

9394
def run_module():

0 commit comments

Comments
 (0)