File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -562,13 +562,17 @@ func (n *NDTParser) fixValues(r schema.Web100ValueMap) {
562562 }
563563
564564 // If there is no meta file then the server hostname will not be set.
565- if connSpec ["server_hostname" ] == "" {
565+ // We must check for presence and an empty value.
566+ hn , ok := connSpec ["server_hostname" ]
567+ if ! ok || hn == "" {
566568 data , err := etl .ValidateTestPath (n .taskFileName )
567569 if err != nil {
568- log .Println ("WARNING: taskFileName is unexpectedly invalid." )
570+ // The current filename is ambiguous, but the timestamp should help.
571+ log .Printf ("WARNING: taskFileName is unexpectedly invalid: %s %s: %q" ,
572+ n .taskFileName , n .timestamp , err )
569573 } else {
570- connSpec [ "server_hostname" ] = fmt .Sprintf (
571- "%s.%s.%s" , data .Host , data .Pod , etl .MlabDomain )
574+ connSpec . SetString ( "server_hostname" , fmt .Sprintf (
575+ "%s.%s.%s" , data .Host , data .Pod , etl .MlabDomain ))
572576 }
573577 }
574578
Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ func TestNDTParser(t *testing.T) {
7171 t .Fatalf (err .Error ())
7272 }
7373
74- meta := map [string ]bigquery.Value {"filename" : "tarfile.tgz" }
74+ // Use a valid archive name.
75+ meta := map [string ]bigquery.Value {"filename" : "gs://mlab-test-bucket/ndt/2017/06/13/20170613T000000Z-mlab3-vie01-ndt-0186.tgz" }
7576 err = n .ParseAndInsert (meta , s2cName + ".gz" , s2cData )
7677 if err != nil {
7778 t .Fatalf (err .Error ())
@@ -100,6 +101,9 @@ func TestNDTParser(t *testing.T) {
100101 // Extract the values saved to the inserter.
101102 actualValues := ins .data [0 ].(* bq.MapSaver ).Values
102103 expectedValues := schema.Web100ValueMap {
104+ "connection_spec" : schema.Web100ValueMap {
105+ "server_hostname" : "mlab3.vie01.measurement-lab.org" ,
106+ },
103107 "web100_log_entry" : schema.Web100ValueMap {
104108 "version" : "2.5.27 201001301335 net100" ,
105109 "snap" : schema.Web100ValueMap {
You can’t perform that action at this time.
0 commit comments