Skip to content
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

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

MatthiasWinzeler
Copy link
Contributor

Hi folks

As discussed with @rainerleber in #16 (comment), the file headers are in need of some alignment ;)

This PR does the following:

  • remove any encoding header since they are not needed with python 3 (do we need to support python 2 still?)
  • remove any shebangs in the module_utils, add them to modules (only these are invoked directly)

Along the way I fixed a typo and arranged some imports - see inline comments.

@@ -6,8 +6,8 @@
URL_SERVICE_INCIDENT = 'https://launchpad.support.sap.com/services/odata/incidentws'
URL_SERVICE_USER_ADMIN = 'https://launchpad.support.sap.com/services/odata/useradminsrv'
URL_SOFTWARE_DOWNLOAD = 'https://softwaredownloads.sap.com'
# Maintainance Planner
URL_MAINTAINANCE_PLANNER = 'https://maintenanceplanner.cfapps.eu10.hana.ondemand.com'
# Maintenance Planner
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed typo


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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was no reference to sap_sso_login in this file, causing linters to complain - so I moved the imports into the files that actually reference the sap_sso_login function.

from . import constants as C
from .sap_api_common import _request
from .sap_id_sso import sap_sso_login
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -5,7 +5,6 @@

from . import constants as C
from .sap_api_common import _request
from .sap_id_sso import sap_sso_login
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@rainerleber rainerleber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @MatthiasWinzeler thank you for the alignment :-)

@MatthiasWinzeler
Copy link
Contributor Author

@rainerleber thanks! Can you merge the PR? I'm afraid I don't have the rights:

Only those with write access to this repository can merge pull requests.

@sean-freeman
Copy link
Member

PR #16 merged to main instead of dev, second part of the PR (this) has been left behind. Merging to main and then performing merge back.

@sean-freeman sean-freeman merged commit dae0525 into sap-linuxlab:main Nov 28, 2023
1 check passed
@MatthiasWinzeler MatthiasWinzeler deleted the align-file-headers branch November 28, 2023 15:05
@MatthiasWinzeler
Copy link
Contributor Author

@sean-freeman thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants