Skip to content

Commit f603e84

Browse files
committed
Add another connector to snap
1 parent 6f7a096 commit f603e84

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ run-browser: ## Start Glances in browser mode (RPC)
287287
run-issue: ## Start Glances in issue mode
288288
./venv/bin/python -m glances -C ./conf/glances.conf --issue
289289

290+
run-multipass: ## Install and start Glances in a VM (only available on Ubuntu with multipass already installed)
291+
multipass launch -n glances-on-lts lts
292+
multipass exec glances-on-lts -- sudo snap install glances
293+
multipass exec glances-on-lts -- glances
294+
multipass stop glances-on-lts
295+
multipass delete glances-on-lts
296+
290297
show-version: ## Show Glances version number
291298
./venv/bin/python -m glances -C ./conf/glances.conf -V
292299

glances/standalone.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,14 @@ def __serve_once(self):
140140
"""
141141
# Update stats
142142
# Start a counter used to compute the time needed
143-
counter = Counter()
143+
counter_update = Counter()
144144
self.stats.update()
145-
logger.debug(f'Stats updated duration: {counter.get()} seconds')
145+
logger.debug(f'Stats updated duration: {counter_update.get()} seconds')
146146

147147
# Patch for issue1326 to avoid < 0 refresh
148-
adapted_refresh = (self.refresh_time - counter.get()) if (self.refresh_time - counter.get()) > 0 else 0
148+
adapted_refresh = (
149+
(self.refresh_time - counter_update.get()) if (self.refresh_time - counter_update.get()) > 0 else 0
150+
)
149151

150152
# Display stats
151153
# and wait refresh_time - counter
@@ -179,7 +181,7 @@ def serve_n(self, n=1):
179181
def serve_forever(self):
180182
"""Wrapper to the serve_forever function."""
181183
if self.args.stop_after:
182-
self.serve_n(self.args.stop_after)
184+
self.serve_n(n=self.args.stop_after)
183185
else:
184186
while self.__serve_once():
185187
pass

snap/snapcraft.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: glances
2-
version: '4.1.2+build01' # Put the current stable version+buildXX
2+
version: '4.1.2+build02' # Put the current stable version+buildXX
33

44
summary: Glances an Eye on your system. A top/htop alternative.
55
description: |
@@ -17,7 +17,7 @@ apps:
1717
command: bin/glances
1818
plugs: # https://snapcraft.io/docs/supported-interfaces
1919
- network
20-
- system-observe
20+
- system-observe # This one should give read access to all the system
2121
- mount-observe
2222
- hardware-observe
2323
- log-observe
@@ -32,6 +32,7 @@ apps:
3232
- power-control
3333
- process-control
3434
- network-setup-observe
35+
- all-home
3536
environment:
3637
LANG: C.UTF-8
3738
LC_ALL: C.UTF-8

0 commit comments

Comments
 (0)