Skip to content

Instantly share code, notes, and snippets.

Created January 5, 2015 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f70caf152c99f9aed2e4 to your computer and use it in GitHub Desktop.
Save anonymous/f70caf152c99f9aed2e4 to your computer and use it in GitHub Desktop.
stdin
From e95e881c562b30233df57f7f84096e8417113bdf Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 19:43:42 +0100
Subject: [PATCH 1/8] Add 'bg' to the invisible mount options
---
salt/states/mount.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index 79e7205..1d1976a 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -162,7 +162,7 @@ def mounted(name,
if uuid_device and uuid_device not in device_list:
device_list.append(uuid_device)
if opts:
- mount_invisible_options = ['defaults', 'comment', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password']
+ mount_invisible_options = ['bg', 'defaults', 'comment', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password']
for opt in opts:
comment_option = opt.split('=')[0]
if comment_option == 'comment':
--
2.0.5
From 74893820957a69687d2f99046396981dedbce9b9 Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 19:45:16 +0100
Subject: [PATCH 2/8] Add 'soft' to the invisible mount options
---
salt/states/mount.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index 1d1976a..e769321 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -162,7 +162,7 @@ def mounted(name,
if uuid_device and uuid_device not in device_list:
device_list.append(uuid_device)
if opts:
- mount_invisible_options = ['bg', 'defaults', 'comment', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password']
+ mount_invisible_options = ['bg', 'defaults', 'comment', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password', 'soft']
for opt in opts:
comment_option = opt.split('=')[0]
if comment_option == 'comment':
--
2.0.5
From 6d3df3c339bd8d76861373721353e9b0fa2fa5d9 Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 19:50:29 +0100
Subject: [PATCH 3/8] Add '_netdev' to the invisible mount options
---
salt/states/mount.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index e769321..5ac2ef0 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -162,7 +162,7 @@ def mounted(name,
if uuid_device and uuid_device not in device_list:
device_list.append(uuid_device)
if opts:
- mount_invisible_options = ['bg', 'defaults', 'comment', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password', 'soft']
+ mount_invisible_options = ['bg', 'defaults', 'comment', '_netdev', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password', 'soft']
for opt in opts:
comment_option = opt.split('=')[0]
if comment_option == 'comment':
--
2.0.5
From 5febb56bd5d66c0d65f3f7a3af95fefb2207a3c2 Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 20:03:01 +0100
Subject: [PATCH 4/8] The 'mount_invisible_options' list grew too long. Split
it into 1 option per line.
---
salt/states/mount.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index 5ac2ef0..ef2496f 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -162,7 +162,18 @@ def mounted(name,
if uuid_device and uuid_device not in device_list:
device_list.append(uuid_device)
if opts:
- mount_invisible_options = ['bg', 'defaults', 'comment', '_netdev', 'nobootwait', 'reconnect', 'delay_connect', 'nofail', 'password', 'soft']
+ mount_invisible_options = [
+ 'bg',
+ 'defaults',
+ 'comment',
+ '_netdev',
+ 'nobootwait',
+ 'reconnect',
+ 'delay_connect',
+ 'nofail',
+ 'password',
+ 'soft'
+ ]
for opt in opts:
comment_option = opt.split('=')[0]
if comment_option == 'comment':
--
2.0.5
From a1b0d5d430572a5c077619f8e904bd64eb062d02 Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 20:26:12 +0100
Subject: [PATCH 5/8] Sort options alphabetically.
---
salt/states/mount.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index ef2496f..15fa228 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -163,15 +163,15 @@ def mounted(name,
device_list.append(uuid_device)
if opts:
mount_invisible_options = [
+ '_netdev',
'bg',
- 'defaults',
'comment',
- '_netdev',
- 'nobootwait',
- 'reconnect',
+ 'defaults',
'delay_connect',
+ 'nobootwait',
'nofail',
'password',
+ 'reconnect',
'soft'
]
for opt in opts:
--
2.0.5
From 6db01ba2a98056704483619b3925e1831eba8bbe Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 20:28:37 +0100
Subject: [PATCH 6/8] Generalize the approach used for 'comment_option' to
allow arbitrary key-value options.
---
salt/states/mount.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index 15fa228..7da7267 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -174,10 +174,15 @@ def mounted(name,
'reconnect',
'soft'
]
+ # options which are provided as key=value (e.g. password=Zohp5ohb)
+ mount_invisible_keys = [
+ 'comment',
+ 'password'
+ ]
for opt in opts:
- comment_option = opt.split('=')[0]
- if comment_option == 'comment':
- opt = comment_option
+ keyval_option = opt.split('=')[0]
+ if keyval_option in mount_invisible_keys:
+ opt = keyval_option
if opt not in active[real_name]['opts'] and opt not in active[real_name]['superopts'] and opt not in mount_invisible_options:
if __opts__['test']:
ret['result'] = None
--
2.0.5
From 8e6e980587c13c98567f4560461fd3e63fe7b5bd Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 20:32:46 +0100
Subject: [PATCH 7/8] Add 'intr' and 'retry' to the invisible mount options
---
salt/states/mount.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index 7da7267..70b3fcd 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -168,16 +168,19 @@ def mounted(name,
'comment',
'defaults',
'delay_connect',
+ 'intr',
'nobootwait',
'nofail',
'password',
'reconnect',
- 'soft'
+ 'retry',
+ 'soft',
]
# options which are provided as key=value (e.g. password=Zohp5ohb)
mount_invisible_keys = [
'comment',
- 'password'
+ 'password',
+ 'retry',
]
for opt in opts:
keyval_option = opt.split('=')[0]
--
2.0.5
From 19b5e9806878467a9b2650ec8a3d0d1306f06696 Mon Sep 17 00:00:00 2001
From: Elias Probst <mail@eliasprobst.eu>
Date: Mon, 5 Jan 2015 20:35:15 +0100
Subject: [PATCH 8/8] Add 'actimeo' to the invisible mount options
---
salt/states/mount.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/salt/states/mount.py b/salt/states/mount.py
index 70b3fcd..521c5e2 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -164,6 +164,7 @@ def mounted(name,
if opts:
mount_invisible_options = [
'_netdev',
+ 'actimeo'
'bg',
'comment',
'defaults',
@@ -178,6 +179,7 @@ def mounted(name,
]
# options which are provided as key=value (e.g. password=Zohp5ohb)
mount_invisible_keys = [
+ 'actimeo'
'comment',
'password',
'retry',
--
2.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment