Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions bin/README
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
= Intro =
We are moving various scripts and tools into a more logical location and will
as a start just link to the existing paths in this folder so that one can use
them as
= Modernization and Clean Up =
We are cleaning up and moving various scripts and tools into a more logical
location and will as a start just link to the existing paths in this folder so
that one can use them as
/path/to/bin/X
Long term we will likely move them there instead and perhaps only preserve
symlinks to still support the original paths for a while.

Some scripts and tools may still expect certain relative paths to e.g. the MiGserver.conf file but you can always override it with something like:
MIG_CONF=/path/to/my/MiGserver.conf ./bin/searchusers.py
Some scripts and tools may still expect certain relative paths to e.g. the
MiGserver.conf file but you can always override it with something like:
MIG_CONF=/path/to/my/MiGserver.conf /path/to/bin/searchusers.py

The clean up also means that any code placed here MUST comply with the project
style guides, be lint clean, documented and have decent unit test coverage.

You may want to use autopep8, pylint, flake8, ruff or 'make lint' targets once
available to help verify.
The black code formatter and isort may also come in handy. To apply them on
the code in $TARGET file please run:
black --line-length=80 $TARGET
isort --line-length=80 -m=HANGING_INDENT $TARGET
in that order on code files to preserve our existing hanging indent imports
instead of the exotic black import style with parentheses.
10 changes: 4 additions & 6 deletions bin/addheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# --- END_HEADER ---
#
Expand Down Expand Up @@ -92,9 +91,8 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA."""
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA."""


def check_header(path, var_dict, preamble_lines=100):
Expand Down
1 change: 1 addition & 0 deletions bin/checkcloud.py
1 change: 1 addition & 0 deletions bin/checktwofactor.py
1 change: 1 addition & 0 deletions bin/chkenabled.py
1 change: 1 addition & 0 deletions bin/cleansessions.py
1 change: 1 addition & 0 deletions bin/createresource.py
1 change: 1 addition & 0 deletions bin/createuser.py
1 change: 1 addition & 0 deletions bin/deleteuser.py
1 change: 1 addition & 0 deletions bin/editgdpuser.py
1 change: 1 addition & 0 deletions bin/editmeta.py
1 change: 1 addition & 0 deletions bin/edituser.py
1 change: 1 addition & 0 deletions bin/genoiddiscovery.py
1 change: 1 addition & 0 deletions bin/importdoi.py
1 change: 1 addition & 0 deletions bin/importusers.py
1 change: 1 addition & 0 deletions bin/indexdoi.py
1 change: 1 addition & 0 deletions bin/managecloud.py
1 change: 1 addition & 0 deletions bin/notifyexpire.py
1 change: 1 addition & 0 deletions bin/notifymigoid.py
1 change: 1 addition & 0 deletions bin/notifypassword.py
1 change: 1 addition & 0 deletions bin/refreshusers.py
1 change: 1 addition & 0 deletions bin/rejectuser.py
1 change: 1 addition & 0 deletions bin/reqacceptpeer.py
1 change: 1 addition & 0 deletions bin/reset2fakey.py
1 change: 1 addition & 0 deletions bin/sftpfailinfo.py
1 change: 1 addition & 0 deletions bin/usagestats.py
1 change: 1 addition & 0 deletions bin/verifyarchives.py
13 changes: 7 additions & 6 deletions mig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#
# --- BEGIN_HEADER ---
#
# __init__ - package marker
# Copyright (C) 2003-2020 The MiG Project lead by Brian Vinter
# __init__ - package init
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
#
# This file is part of MiG.
#
Expand All @@ -19,15 +19,16 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -- END_HEADER ---
#

"""This file is needed to tell python that this dir is a package
so that other modules can call, say, import mig.shared.base
Please refer to http://www.network-theory.co.uk/docs/pytut/tut_51.html
so that all modules can call, say, import mig.shared.base
Please refer e.g. to
https://docs.python.org/3/tutorial/modules.html#packages
and
https://www.python.org/dev/peps/pep-0008/#imports
for details
Expand Down
25 changes: 17 additions & 8 deletions mig/cgi-bin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#
# --- BEGIN_HEADER ---
#
# __init__ - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
# __init__ - package init
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
#
# This file is part of MiG.
#
Expand All @@ -19,13 +19,22 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -- END_HEADER ---
#

# This file is needed to tell python that this dir is a package
# so that other modules can call, say, import shared.editing
# Please refer to http://www.network-theory.co.uk/docs/pytut/tut_51.html
# for details.
"""This file is needed to tell python that this dir is a package
so that all modules can call, say, import mig.shared.base
Please refer e.g. to
https://docs.python.org/3/tutorial/modules.html#packages
and
https://www.python.org/dev/peps/pep-0008/#imports
for details
"""

__dummy = True

# above line is only to make python tidy behave and not
# move module doc string inside header
12 changes: 8 additions & 4 deletions mig/lib/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ efforts.
That also means that any code placed here MUST comply with the project style
guides, be lint clean, documented and have decent unit test coverage.

You may want to use autopep8, pylint, ruff or any available make lint targets
to help verify.
The black code formatter and isort may also come in handy. You can see usage
hints in `.github/workflows/python-stylecheck.yml`.
You may want to use autopep8, pylint, flake8, ruff or 'make lint' targets once
available to help verify.
The black code formatter and isort may also come in handy. To apply them on
the code in $TARGET file please run:
black --line-length=80 $TARGET
isort --line-length=80 -m=HANGING_INDENT $TARGET
in that order on code files to preserve our existing hanging indent imports
instead of the exotic black import style with parentheses.
40 changes: 40 additions & 0 deletions mig/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# __init__ - package init
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# MiG is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -- END_HEADER ---
#

"""This file is needed to tell python that this dir is a package
so that all modules can call, say, import mig.lib.daemon
Please refer e.g. to
https://docs.python.org/3/tutorial/modules.html#packages
and
https://www.python.org/dev/peps/pep-0008/#imports
for details
"""

__dummy = True

# above line is only to make python tidy behave and not
# move module doc string inside header
13 changes: 7 additions & 6 deletions mig/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#
# --- BEGIN_HEADER ---
#
# __init__ - package marker
# Copyright (C) 2003-2020 The MiG Project lead by Brian Vinter
# __init__ - package init
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
#
# This file is part of MiG.
#
Expand All @@ -19,15 +19,16 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -- END_HEADER ---
#

"""This file is needed to tell python that this dir is a package
so that other modules can call, say, import mig.server.jobscriptgenerator
Please refer to http://www.network-theory.co.uk/docs/pytut/tut_51.html
so that all modules can call, say, import mig.shared.base
Please refer e.g. to
https://docs.python.org/3/tutorial/modules.html#packages
and
https://www.python.org/dev/peps/pep-0008/#imports
for details
Expand Down
17 changes: 10 additions & 7 deletions mig/shared/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# __init__ - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
# __init__ - package init
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
#
# This file is part of MiG.
#
Expand All @@ -19,15 +19,18 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -- END_HEADER ---
#

"""This file is needed to tell python that this dir is a package
so that other modules can call, say, import shared.editing
Please refer to http://www.network-theory.co.uk/docs/pytut/tut_51.html
so that all modules can call, say, import mig.shared.base
Please refer e.g. to
https://docs.python.org/3/tutorial/modules.html#packages
and
https://www.python.org/dev/peps/pep-0008/#imports
for details
"""

Expand Down
27 changes: 18 additions & 9 deletions mig/shared/functionality/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# __init__ - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
# __init__ - package init
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
#
# This file is part of MiG.
#
Expand All @@ -19,13 +19,22 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -- END_HEADER ---
#

# This file is needed to tell python that this dir is a package
# so that other modules can call, say, import shared.editing
# Please refer to http://www.network-theory.co.uk/docs/pytut/tut_51.html
# for details.
"""This file is needed to tell python that this dir is a package
so that all modules can call, say, import mig.shared.base
Please refer e.g. to
https://docs.python.org/3/tutorial/modules.html#packages
and
https://www.python.org/dev/peps/pep-0008/#imports
for details
"""

__dummy = True

# above line is only to make python tidy behave and not
# move module doc string inside header
Loading
Loading