Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mailman-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
irt-public
mailman-tools
Commits
02a3752a
Commit
02a3752a
authored
6 years ago
by
Conrad Holmberg
Browse files
Options
Downloads
Patches
Plain Diff
Trying to fix bug with the scrub option to do only once in members loop.
parent
a6b50995
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
manage_members.py
+6
-2
6 additions, 2 deletions
manage_members.py
with
6 additions
and
2 deletions
manage_members.py
+
6
−
2
View file @
02a3752a
...
...
@@ -50,6 +50,7 @@ def restore_members( members_file, ml_fqdn, scrub ):
"""
Creates Code to Restore Members of a source/target email list.
"""
"""
The scrub option determines if the current target scriptions are wiped.
"""
tgt_list
=
None
if
members_file
==
'
-
'
:
json_file
=
sys
.
stdin
else
:
...
...
@@ -60,7 +61,7 @@ def restore_members( members_file, ml_fqdn, scrub ):
# get target the email list
if
(
ml_fqdn
==
src_member
[
'
list_fqdn
'
]):
#deletes all members in the list
if
(
scrub
):
if
(
scrub
and
tgt_list
is
None
):
scrub_members
(
ml_fqdn
)
tgt_list
=
client
.
get_list
(
ml_fqdn
)
# Get members from the current email list
...
...
@@ -128,7 +129,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
'
-l
'
,
'
--list-fqdn
'
,
required
=
True
,
help
=
'
Required Mailing List
'
)
parser
.
add_argument
(
'
-d
'
,
'
--dump
'
,
action
=
'
store_true
'
,
help
=
'
Dumps a mailing list to stout in json format.
'
)
parser
.
add_argument
(
'
-r
'
,
'
--restore
'
,
action
=
'
store_true
'
,
parser
.
add_argument
(
'
-r
'
,
'
--restore
'
,
help
=
'
Subscribes users from a source email list into a tareget email list if not already added.
'
)
parser
.
add_argument
(
'
-s
'
,
'
--scrub
'
,
action
=
'
store_true
'
,
help
=
'
Removes all users from a target email list and suscribes the current.
'
)
...
...
@@ -167,3 +168,6 @@ if __name__ == '__main__':
restore_members
(
args
.
restore
,
ml_fqdn
,
True
)
else
:
restore_members
(
args
.
restore
,
ml_fqdn
,
False
)
else
:
print
(
"
Error: Need to perform a dump (-d) or restore (-r) of the email list
"
+
ml_fqdn
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment