Skip to content

Commit

Permalink
Also add fabric as a test option
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemartinlogan committed Jan 22, 2025
1 parent 78a2882 commit e8aab7c
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions jarvis_util/introspect/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class NetTest(FiInfo):
def __init__(self, port, exec_info):
super().__init__(exec_info)
self.working = []
df = self.df[['provider', 'domain']].drop_duplicates()
df = self.df[['provider', 'domain', 'fabric']].drop_duplicates()
print(f'About to test {len(df)} networks')
for net in df.rows:
provider = net['provider']
Expand All @@ -391,7 +391,7 @@ def __init__(self, port, exec_info):
ping = ChiNetPingTest(provider, domain, port, exec_info)
if ping.exit_code == 0:
net['shared'] = True
self.working = sdf.SmallDf(self.working)
self.df = sdf.SmallDf(self.working)


class ResourceGraph:
Expand Down Expand Up @@ -428,10 +428,10 @@ def __init__(self):
self.fs_columns = [
'parent', 'device', 'mount', 'model', 'dev_type',
'fs_type', 'uuid',
'avail', 'shared', 'host',
'avail', 'shared', 'needs_root'
]
self.net_columns = [
'provider', 'fabric', 'domain', 'host',
'provider', 'fabric', 'domain',
'speed', 'shared'
]
self.create()
Expand Down Expand Up @@ -668,13 +668,15 @@ def _try_user_access_paths(self, dev, fs):
]
for path in paths:
if self._try_user_access(fs, path, path == dev['mount']):
dev['needs_root'] = True
dev['needs_root'] = False
return path
dev['needs_root'] = False
dev['needs_root'] = True
return dev['mount']

def _try_user_access(self, fs, mount, known_mount=False):
try:
if mount.startswith('/boot'):
print(mount)
if not known_mount and self._check_if_mounted(fs, mount):
return False
if os.access(mount, os.R_OK) and os.access(mount, os.W_OK):
Expand Down Expand Up @@ -975,17 +977,7 @@ def find_net_info(self,

def print_df(self, df):
if 'device' in df.columns:
if 'host' in df.columns:
col = ['host', 'mount', 'device', 'dev_type', 'shared',
'avail', 'tran', 'rota', 'fs_type']
df = df[col]
df = df.sort_values('host')
print(df.to_string())
else:
col = ['device', 'mount', 'dev_type', 'shared',
'avail', 'tran', 'rota', 'fs_type']
df = df[col]
print(df.to_string())
print(df.sort_values('mount').to_string())
else:
print(df.sort_values('provider').to_string())

Expand Down

0 comments on commit e8aab7c

Please sign in to comment.