ocket8888 commented on a change in pull request #4379: Rewrite isos to Golang URL: https://github.com/apache/trafficcontrol/pull/4379#discussion_r382756501
########## File path: traffic_ops/traffic_ops_golang/iso/iso.go ########## @@ -0,0 +1,368 @@ +// Package iso provides support for generating ISO images. +package iso + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import ( + "encoding/json" + "errors" + "fmt" + "net" + "net/http" + "os/exec" + "path/filepath" + "strings" + + "github.com/apache/trafficcontrol/lib/go-log" + "github.com/apache/trafficcontrol/lib/go-rfc" + "github.com/apache/trafficcontrol/lib/go-tc" + "github.com/apache/trafficcontrol/lib/go-util" + "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api" + "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/auth" + "github.com/jmoiron/sqlx" +) + +// Various directories and filenames related to ISO generation. +const ( + cfgDefaultDir = "/var/www/files" // Default directory containing config file + cfgFilename = "osversions.json" // The JSON config file containing mapping of OS names to directories + cfgFilenamePerl = "osversions.cfg" // Config file name in the Perl version Review comment: I feel like these should just be implemented at the configuration parsing step. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
