-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
align headers, clean up imports & fix typo #17
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/usr/bin/env python3 | ||
# coding: utf-8 | ||
|
||
import logging | ||
import re | ||
from urllib.parse import urlparse | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/usr/bin/env python3 | ||
# coding: utf-8 | ||
|
||
import json | ||
import logging | ||
import re | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#!/user/bin/env python3 | ||
# coding: utf-8 | ||
|
||
import os | ||
import pathlib | ||
import re | ||
import time | ||
|
@@ -11,11 +7,10 @@ | |
from bs4 import BeautifulSoup | ||
from lxml import etree | ||
from requests.auth import HTTPBasicAuth | ||
from requests.sessions import session | ||
|
||
from . import constants as C | ||
from .sap_api_common import _request, https_session | ||
from .sap_id_sso import _get_sso_endpoint_meta, sap_sso_login | ||
from .sap_id_sso import _get_sso_endpoint_meta | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there was no reference to |
||
|
||
_MP_XSRF_TOKEN = None | ||
_MP_TRANSACTIONS = None | ||
|
@@ -24,7 +19,7 @@ | |
def auth_maintenance_planner(): | ||
# Clear mp relevant cookies for avoiding unexpected responses. | ||
_clear_mp_cookies('maintenanceplanner') | ||
res = _request(C.URL_MAINTAINANCE_PLANNER) | ||
res = _request(C.URL_MAINTENANCE_PLANNER) | ||
sig_re = re.compile('signature=(.*?);path=\/";location="(.*)"') | ||
signature, redirect = re.search(sig_re, res.text).groups() | ||
|
||
|
@@ -35,7 +30,7 @@ def auth_maintenance_planner(): | |
'locationAfterLogin': '%2F' | ||
} | ||
|
||
MP_DOMAIN = C.URL_MAINTAINANCE_PLANNER.replace('https://', '') | ||
MP_DOMAIN = C.URL_MAINTENANCE_PLANNER.replace('https://', '') | ||
for k, v in mp_cookies.items(): | ||
https_session.cookies.set(k, v, domain=MP_DOMAIN, path='/') | ||
|
||
|
@@ -68,7 +63,7 @@ def auth_userapps(): | |
|
||
|
||
def get_mp_user_details(): | ||
url = urljoin(C.URL_MAINTAINANCE_PLANNER, | ||
url = urljoin(C.URL_MAINTENANCE_PLANNER, | ||
'/MCP/MPHomePageController/getUserDetailsDisplay') | ||
params = {'_': int(time.time() * 1000)} | ||
user = _request(url, params=params).json() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
#!/user/bin/env python3 | ||
# coding: utf-8 | ||
|
||
from . import constants as C | ||
from .sap_api_common import _request | ||
from .sap_id_sso import sap_sso_login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
|
||
def get_software_catalog(): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/user/bin/env python3 | ||
# coding: utf-8 | ||
|
||
import hashlib | ||
import json | ||
import logging | ||
|
@@ -12,7 +9,7 @@ | |
|
||
from . import constants as C | ||
from .sap_api_common import _request, https_session | ||
from .sap_id_sso import _get_sso_endpoint_meta, sap_sso_login | ||
from .sap_id_sso import _get_sso_endpoint_meta | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
|
||
from . import constants as C | ||
from .sap_api_common import _request | ||
from .sap_id_sso import sap_sso_login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
|
||
def search_software_fuzzy(query, max=None, csv_filename=None): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python3 | ||
|
||
# SAP Maintenance Planner files retrieval | ||
|
||
|
@@ -69,6 +69,7 @@ | |
from ..module_utils.sap_launchpad_maintenance_planner_runner import * | ||
from ..module_utils.sap_launchpad_software_center_download_runner import \ | ||
is_download_link_available | ||
from ..module_utils.sap_id_sso import sap_sso_login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
|
||
def run_module(): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python3 | ||
|
||
# SAP Maintenance Planner Stack XML download | ||
|
||
|
@@ -69,6 +69,7 @@ | |
|
||
# Import runner | ||
from ..module_utils.sap_launchpad_maintenance_planner_runner import * | ||
from ..module_utils.sap_id_sso import sap_sso_login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
|
||
def run_module(): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python3 | ||
|
||
# SAP software download module | ||
|
||
|
@@ -88,6 +88,7 @@ | |
|
||
# Import runner | ||
from ..module_utils.sap_launchpad_software_center_download_runner import * | ||
from ..module_utils.sap_id_sso import sap_sso_login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
|
||
def run_module(): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed typo