@@ -44,21 +44,6 @@ def setup(self):
4444 '/var/snap/openstack/current/config.yaml' ,
4545 ])
4646
47- self .add_cmd_output ([
48- 'sunbeam cluster list' ,
49- 'sunbeam cluster list --format yaml' ,
50- 'sunbeam manifest list' ,
51- ], snap_cmd = True )
52-
53- manifest_raw = self .collect_cmd_output (
54- 'sunbeam manifest list --format yaml' )
55-
56- if manifest_raw ['status' ] == 0 :
57- manifests = yaml .safe_load (manifest_raw ['output' ])
58- for manifest in manifests :
59- self .add_cmd_output (
60- f'sunbeam manifest show --id { manifest ["manifestid" ]} ' )
61-
6247 sunbeam_user = self .get_option ("sunbeam-user" )
6348 try :
6449 user_pwd = pwd .getpwnam (sunbeam_user )
@@ -71,12 +56,47 @@ def setup(self):
7156 return
7257
7358 if user_pwd :
59+ self .add_cmd_output ([
60+ 'sunbeam cluster list' ,
61+ 'sunbeam cluster list --format yaml' ,
62+ 'sunbeam manifest list' ,
63+ 'sunbeam deployment list' ,
64+ ], snap_cmd = True , runas = sunbeam_user )
65+
66+ manifest_raw = self .collect_cmd_output (
67+ 'sunbeam manifest list --format yaml' ,
68+ runas = sunbeam_user
69+ )
70+
71+ if manifest_raw ['status' ] == 0 :
72+ manifests = yaml .safe_load (manifest_raw ['output' ])
73+ for manifest in manifests :
74+ self .add_cmd_output (
75+ f'sunbeam manifest show { manifest ["manifestid" ]} ' ,
76+ snap_cmd = True , runas = sunbeam_user
77+ )
78+
79+ deployment_raw = self .collect_cmd_output (
80+ 'sunbeam deployment list --format yaml' ,
81+ runas = sunbeam_user
82+ )
83+
84+ if deployment_raw ['status' ] == 0 :
85+ deployments = yaml .safe_load (deployment_raw ['output' ])
86+ for deployment in deployments ['deployments' ]:
87+ self .add_cmd_output ([
88+ f'sunbeam deployment show { deployment ["name" ]} ' ,
89+ f'sunbeam deployment show { deployment ["name" ]} '
90+ '--format yaml' ,
91+ ], snap_cmd = True , runas = sunbeam_user )
92+
7493 sb_snap_homedir = f'{ user_pwd .pw_dir } /snap/openstack/common'
7594
7695 self .add_copy_spec ([
7796 f"{ sb_snap_homedir } /*.log" ,
7897 f"{ sb_snap_homedir } /etc/*/*.log" ,
7998 f"{ sb_snap_homedir } /logs/*.log" ,
99+ f"{ sb_snap_homedir } /reports/*.yaml" ,
80100 ])
81101
82102 if self .get_option ("juju-allow-login" ):
0 commit comments