update-linux 3.3.2__tar.gz → 3.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: update-linux
3
- Version: 3.3.2
3
+ Version: 3.4.0
4
4
  Summary: Command to automate the routine updating of packages and system upgrading for Unix systems.
5
5
  Author-email: Barry Scott <barry@barrys-emacs.org>
6
6
  License: Apache-2.0
@@ -135,38 +135,61 @@ For a system-upgrade these steps are used:
135
135
  ## update-linux command
136
136
 
137
137
  ```
138
- Usage: update-linux <options> <group>|<host>...
138
+ Usage: update-linux <options> <group>|<host>|--self...
139
+
140
+ update-linux version 3.4.0
141
+
142
+ Run one of the commands --check, --update, --system-upgrade
143
+ or --install-package on a group of hosts.
144
+
139
145
  group - read from the JSON config file:
140
146
  /home/barry/.config/org.barrys-emacs.update-linux.json
141
147
 
142
- each group is a list of hosts to be updated
148
+ each group is a list of hosts to act on
143
149
 
144
- host - host to be updated
150
+ host - host to on
151
+
152
+ --self - commands apply to this computer.
153
+ By default no reboot is done.
154
+ Use --force-reboot to reboot when required
155
+ to complete the command.
145
156
 
146
157
  options:
147
- --check default Off
158
+ --check (default Off)
148
159
  check if update is required
149
160
 
150
- --debug default Off
161
+ --debug (default Off)
151
162
  print debug messages
152
163
 
153
- --exclude=<host> default None
154
- exclude the <host> from being updated
164
+ --exclude=<group>|<host>[,<group>|<host>]
165
+ exclude the <host> or host in a <group> from being updated
155
166
 
156
- --force-reboot default Off
157
- always reboot host even if no packages where updated
167
+ --force-reboot (default Off)
168
+ reboot if required for --update --self.
169
+ For remote system --update always reboot host even if no packages where updated
158
170
 
159
- --help default Off
171
+ --help (default Off)
160
172
  print this help
161
173
 
162
- --install-package=<package> default None
174
+ --install-package=<package>
163
175
  install <package> only
164
176
 
165
- --list-config default Off
177
+ --list-config (default Off)
166
178
  list the configuration from the JSON config file
167
179
 
168
- --system-upgrade=<version> default None
180
+ --list-hosts (default Off)
181
+ list the matching hostnames
182
+
183
+ --system-upgrade=<version>
169
184
  perform a system upgrade to version <version>
185
+
186
+ --update (default Off)
187
+ perform update of installed packages
188
+
189
+ --self (default Off)
190
+ apply command to this computer
191
+
192
+
170
193
  ```
171
194
 
172
195
  ## update-linux log files
@@ -114,38 +114,61 @@ For a system-upgrade these steps are used:
114
114
  ## update-linux command
115
115
 
116
116
  ```
117
- Usage: update-linux <options> <group>|<host>...
117
+ Usage: update-linux <options> <group>|<host>|--self...
118
+
119
+ update-linux version 3.4.0
120
+
121
+ Run one of the commands --check, --update, --system-upgrade
122
+ or --install-package on a group of hosts.
123
+
118
124
  group - read from the JSON config file:
119
125
  /home/barry/.config/org.barrys-emacs.update-linux.json
120
126
 
121
- each group is a list of hosts to be updated
127
+ each group is a list of hosts to act on
122
128
 
123
- host - host to be updated
129
+ host - host to on
130
+
131
+ --self - commands apply to this computer.
132
+ By default no reboot is done.
133
+ Use --force-reboot to reboot when required
134
+ to complete the command.
124
135
 
125
136
  options:
126
- --check default Off
137
+ --check (default Off)
127
138
  check if update is required
128
139
 
129
- --debug default Off
140
+ --debug (default Off)
130
141
  print debug messages
131
142
 
132
- --exclude=<host> default None
133
- exclude the <host> from being updated
143
+ --exclude=<group>|<host>[,<group>|<host>]
144
+ exclude the <host> or host in a <group> from being updated
134
145
 
135
- --force-reboot default Off
136
- always reboot host even if no packages where updated
146
+ --force-reboot (default Off)
147
+ reboot if required for --update --self.
148
+ For remote system --update always reboot host even if no packages where updated
137
149
 
138
- --help default Off
150
+ --help (default Off)
139
151
  print this help
140
152
 
141
- --install-package=<package> default None
153
+ --install-package=<package>
142
154
  install <package> only
143
155
 
144
- --list-config default Off
156
+ --list-config (default Off)
145
157
  list the configuration from the JSON config file
146
158
 
147
- --system-upgrade=<version> default None
159
+ --list-hosts (default Off)
160
+ list the matching hostnames
161
+
162
+ --system-upgrade=<version>
148
163
  perform a system upgrade to version <version>
164
+
165
+ --update (default Off)
166
+ perform update of installed packages
167
+
168
+ --self (default Off)
169
+ apply command to this computer
170
+
171
+
149
172
  ```
150
173
 
151
174
  ## update-linux log files
@@ -9,7 +9,7 @@ import tempfile
9
9
  import json
10
10
  from config_path import ConfigPath # type: ignore
11
11
 
12
- VERSION = '3.3.2'
12
+ VERSION = '3.4.0'
13
13
 
14
14
  default_json_config_template = u'''{
15
15
  "group":
@@ -138,8 +138,8 @@ class UpdateFedora:
138
138
  description='perform update of installed packages' )
139
139
  self.opt_system_upgrade = Option( '--system-upgrade', None, value_type=int, value_name='<version>',
140
140
  description='perform a system upgrade to version <version>' )
141
- self.opt_exclude = Option( '--exclude', None, value_type=str, value_name='<host>',
142
- description='exclude the <host> from being updated' )
141
+ self.opt_exclude = Option( '--exclude', None, value_type=str, value_name='<group>|<host>[,<group>|<host>',
142
+ description='exclude the <host> or hosts in a <group> from being updated' )
143
143
  self.opt_force_reboot = Option( '--force-reboot', False,
144
144
  description='reboot if required for --update --self.\n'
145
145
  'For remote system --update always reboot host even if no packages where updated' )
@@ -147,6 +147,8 @@ class UpdateFedora:
147
147
  description='install <package> only' )
148
148
  self.opt_list_config = Option( '--list-config', False,
149
149
  description='list the configuration from the JSON config file' )
150
+ self.opt_list_hosts = Option( '--list-hosts', False,
151
+ description='list the matching hostnames' )
150
152
  self.opt_update_self = Option( '--self', False,
151
153
  description='apply command to this computer')
152
154
 
@@ -220,7 +222,8 @@ class UpdateFedora:
220
222
 
221
223
  all_to_exclude = []
222
224
  if self.opt_exclude:
223
- all_to_exclude = self.all_groups.get( self.opt_exclude(), self.opt_exclude() )
225
+ for host in self.opt_exclude().split(','):
226
+ all_to_exclude.extend( self.all_groups.get( host, host ) )
224
227
 
225
228
  if self.opt_update_self:
226
229
  self.all_hosts = [None]
@@ -228,13 +231,22 @@ class UpdateFedora:
228
231
  self.all_hosts = list( self.hostIter( positional_args ) )
229
232
 
230
233
  if len(self.all_hosts) == 0:
231
- self.error( '', 'No hosts to update' )
234
+ self.error( '', 'No hosts selected' )
232
235
  print('''
233
236
  For help:
234
237
  %s --help
235
238
  ''' % (appname.name,))
236
239
  return 1
237
240
 
241
+ if self.opt_list_hosts:
242
+ for host in self.all_hosts:
243
+ if host in all_to_exclude:
244
+ continue
245
+
246
+ print(host)
247
+
248
+ return 0
249
+
238
250
  self.summary_log_name = self.logdir / ('update-summary-%s.log' % (self.ts,))
239
251
 
240
252
  with open( self.summary_log_name, 'a' ) as self.summary_log:
@@ -574,7 +586,7 @@ class UpdatePluginFedora:
574
586
  self.app.warn( host, 'Updates available. See<> <>file %s<> <>em for details' % (check_log_name,) )
575
587
 
576
588
  else:
577
- self.app.error( host, 'check-update failed' )
589
+ self.app.error( host, 'check-update failed. See<> <>file %s<> <>em for details' % (check_log_name,) )
578
590
 
579
591
  self.app.checkServices( host, check_log_name )
580
592
 
@@ -612,7 +624,7 @@ class UpdatePluginFedora:
612
624
  self.app.writeLines( update_log_name, stdout )
613
625
 
614
626
  if rc != 0:
615
- self.app.error( host, 'Update failed' )
627
+ self.app.error( host, 'Update failed. See<> <>file %s<> <>em for details' % (update_log_name,) )
616
628
  return
617
629
 
618
630
  if 'Nothing to do.\n' in stdout:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: update-linux
3
- Version: 3.3.2
3
+ Version: 3.4.0
4
4
  Summary: Command to automate the routine updating of packages and system upgrading for Unix systems.
5
5
  Author-email: Barry Scott <barry@barrys-emacs.org>
6
6
  License: Apache-2.0
@@ -135,38 +135,61 @@ For a system-upgrade these steps are used:
135
135
  ## update-linux command
136
136
 
137
137
  ```
138
- Usage: update-linux <options> <group>|<host>...
138
+ Usage: update-linux <options> <group>|<host>|--self...
139
+
140
+ update-linux version 3.4.0
141
+
142
+ Run one of the commands --check, --update, --system-upgrade
143
+ or --install-package on a group of hosts.
144
+
139
145
  group - read from the JSON config file:
140
146
  /home/barry/.config/org.barrys-emacs.update-linux.json
141
147
 
142
- each group is a list of hosts to be updated
148
+ each group is a list of hosts to act on
143
149
 
144
- host - host to be updated
150
+ host - host to on
151
+
152
+ --self - commands apply to this computer.
153
+ By default no reboot is done.
154
+ Use --force-reboot to reboot when required
155
+ to complete the command.
145
156
 
146
157
  options:
147
- --check default Off
158
+ --check (default Off)
148
159
  check if update is required
149
160
 
150
- --debug default Off
161
+ --debug (default Off)
151
162
  print debug messages
152
163
 
153
- --exclude=<host> default None
154
- exclude the <host> from being updated
164
+ --exclude=<group>|<host>[,<group>|<host>]
165
+ exclude the <host> or host in a <group> from being updated
155
166
 
156
- --force-reboot default Off
157
- always reboot host even if no packages where updated
167
+ --force-reboot (default Off)
168
+ reboot if required for --update --self.
169
+ For remote system --update always reboot host even if no packages where updated
158
170
 
159
- --help default Off
171
+ --help (default Off)
160
172
  print this help
161
173
 
162
- --install-package=<package> default None
174
+ --install-package=<package>
163
175
  install <package> only
164
176
 
165
- --list-config default Off
177
+ --list-config (default Off)
166
178
  list the configuration from the JSON config file
167
179
 
168
- --system-upgrade=<version> default None
180
+ --list-hosts (default Off)
181
+ list the matching hostnames
182
+
183
+ --system-upgrade=<version>
169
184
  perform a system upgrade to version <version>
185
+
186
+ --update (default Off)
187
+ perform update of installed packages
188
+
189
+ --self (default Off)
190
+ apply command to this computer
191
+
192
+
170
193
  ```
171
194
 
172
195
  ## update-linux log files
File without changes
File without changes