@@ -40,16 +40,15 @@ def load_metadata
40
40
@module_metadata_cache = @store . transaction ( true ) { @store [ :module_metadata ] }
41
41
validate_data ( copied ) if ( !@module_metadata_cache . nil? && @module_metadata_cache . size > 0 )
42
42
@module_metadata_cache = { } if @module_metadata_cache . nil?
43
- puts "module size #{ @module_metadata_cache . size } "
44
- rescue
43
+ rescue Exception => e
45
44
retries +=1
46
45
47
46
# Try to handle the scenario where the file is corrupted
48
47
if ( retries < 2 && ::File . exist? ( @path_to_user_metadata ) )
49
48
FileUtils . remove ( @path_to_user_metadata , true )
50
49
retry
51
50
else
52
- @console . print_warning ( ' Unable to load module metadata' )
51
+ @console . print_warning ( " Unable to load module metadata: #{ e . message } " )
53
52
end
54
53
end
55
54
@@ -71,20 +70,20 @@ def validate_data(copied)
71
70
def configure_user_store
72
71
copied = false
73
72
@path_to_user_metadata = ::File . join ( Msf ::Config . config_directory , UserMetaDataFile )
74
- @ path_to_base_metadata = ::File . join ( Msf ::Config . install_root , "db" , BaseMetaDataFile )
73
+ path_to_base_metadata = ::File . join ( Msf ::Config . install_root , "db" , BaseMetaDataFile )
75
74
76
75
if ( !::File . exist? ( path_to_base_metadata ) )
77
76
wlog ( "Missing base module metadata file: #{ path_to_base_metadata } " )
78
77
else
79
78
if ( !::File . exist? ( @path_to_user_metadata ) )
80
- FileUtils . cp ( @ path_to_base_metadata, @path_to_user_metadata )
79
+ FileUtils . cp ( path_to_base_metadata , @path_to_user_metadata )
81
80
copied = true
82
81
dlog ( 'Created user based module store' )
83
82
84
83
# Update the user based module store if an updated base file is created/pushed
85
84
elsif ( ::File . mtime ( path_to_base_metadata ) . to_i > ::File . mtime ( @path_to_user_metadata ) . to_i )
86
85
FileUtils . remove ( @path_to_user_metadata , true )
87
- FileUtils . cp ( @ path_to_base_metadata, @path_to_user_metadata )
86
+ FileUtils . cp ( path_to_base_metadata , @path_to_user_metadata )
88
87
copied = true
89
88
dlog ( 'Updated user based module store' )
90
89
end
0 commit comments