// NewgidmapPath returns an option func to configure a LinuxFactory with the
// provided ..
543497
func NewgidmapPath(newgidmapPath string) func(*LinuxFactory) error {
	return func(l *LinuxFactory) error {
		l.NewgidmapPath = newgidmapPath
		return nil
	}
}
401099
func AppCreatedPathFromStage1Rootfs(rootfs, appName string) string {
	return filepath.Join(AppsStatusesPathFromStage1Rootfs(rootfs), fmt.Sprintf("%s-created", appName))
}
616060
func (d *initData) KubeConfigPath() string {
	if d.dryRun {
		d.kubeconfigPath = filepath.Join(d.dryRunDir, kubeadmconstants.AdminKubeConfigFileName)
	}
	return d.kubeconfigPath
}
559297
func NewConfigPaths(baseCertDir string) *SecurityConfigPaths {
	return &SecurityConfigPaths{
		Node: CertPaths{
			Cert: filepath.Join(baseCertDir, nodeTLSCertFilename),
			Key:  filepath.Join(baseCertDir, nodeTLSKeyFilename)},
		RootCA: CertPaths{
			Cert: filepath.Join(baseCertDir, rootCACertFilename),
			Key:  filepath.Join(baseCertDir, rootCAKeyFilename)},
	}
}
670273
func getAppPath(bundleID string) (string, error) {
	var stdout bytes.Buffer

	cmd := exec.Command("mdfind", "kMDItemCFBundleIdentifier ==", bundleID)
	cmd.Stdout = &stdout
	if err := cmd.Run(); err != nil {
		return "", err
	}

	pathOutput := strings.TrimSpace(stdout.String())
	if pathOutput == "" {
		if fi, err := os.Stat("/Applications/Parallels Desktop.app"); err == nil {
			if fi.IsDir() {
				return "/Applications/Parallels Desktop.app", nil
			}
		}

		return "", fmt.Errorf(
			"Could not detect Parallels Desktop! Make sure it is properly installed.")
	}

	return pathOutput, nil
}
66031
func (ac *AppClient) NewAppRequest() *omaha.Request {
	req := omaha.NewRequest()
	req.Version = ac.clientVersion
	req.UserID = ac.userID
	req.SessionID = ac.sessionID
	if ac.isMachine {
		req.IsMachine = 1
	}

	app := req.AddApp(ac.appID, ac.version)
	app.Track = ac.track
	app.OEM = ac.oem

	// MachineID and BootID are non-standard fields used by CoreOS'
	// update_engine and Core Update. Copy their values from the
	// standard UserID and SessionID. Eventually the non-standard
	// fields should be deprecated.
	app.MachineID = req.UserID
	app.BootID = req.SessionID

	return req
}
596201
func ConfigDirPath(projectDirPath string) (string, error) {
	if projectDirPath == "" {
		return "", errors.Errorf("projectDirPath was empty")
	}
	wrapper, err := specdir.New(projectDirPath, layout.WrapperSpec(), nil, specdir.Validate)
	if err != nil {
		return "", err
	}
	return wrapper.Path(layout.WrapperConfigDir), nil
}
232524
func NewUnixSocket(path string, gid int) (net.Listener, error) {
	return NewUnixSocketWithOpts(path, WithChown(0, gid), WithChmod(0660))
}
478082
func NewApiApp(AppId string, AppName string, IsAppFolder bool) *ApiApp {
	s := new(ApiApp)
	s.AppId = AppId
	s.AppName = AppName
	s.IsAppFolder = IsAppFolder
	return s
}
823847
func (c *Client) AppByName(appName, spaceGuid, orgGuid string) (app App, err error) {
	query := url.Values{}
	query.Add("q", fmt.Sprintf("organization_guid:%s", orgGuid))
	query.Add("q", fmt.Sprintf("space_guid:%s", spaceGuid))
	query.Add("q", fmt.Sprintf("name:%s", appName))
	apps, err := c.ListAppsByQuery(query)
	if err != nil {
		return
	}
	if len(apps) == 0 {
		err = fmt.Errorf("No app found with name: `%s` in space with GUID `%s` and org with GUID `%s`", appName, spaceGuid, orgGuid)
		return
	}
	app = apps[0]
	return
}
293219
func (c *Client) GetAppByGuidNoInlineCall(guid string) (App, error) {
	var appResource AppResource
	r := c.NewRequest("GET", "/v2/apps/"+guid)
	resp, err := c.DoRequest(r)
	if err != nil {
		return App{}, errors.Wrap(err, "Error requesting apps")
	}
	defer resp.Body.Close()
	resBody, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return App{}, errors.Wrap(err, "Error reading app response body")
	}

	err = json.Unmarshal(resBody, &appResource)
	if err != nil {
		return App{}, errors.Wrap(err, "Error unmarshalling app")
	}
	app := c.mergeAppResource(appResource)

	// If no Space Information no need to check org.
	if app.SpaceGuid != "" {
		//Getting Spaces Resource
		space, err := app.Space()
		if err != nil {
			errors.Wrap(err, "Unable to get the Space for the apps "+app.Name)
		} else {
			app.SpaceData.Entity = space

		}

		//Getting orgResource
		org, err := app.SpaceData.Entity.Org()
		if err != nil {
			errors.Wrap(err, "Unable to get the Org for the apps "+app.Name)
		} else {
			app.SpaceData.Entity.OrgData.Entity = org
		}
	}

	return app, nil
}
643434
func (s *Set) AddGopathPath(path string) {
	if loader, ok := s.loader.(hasAddGopathPath); ok {
		loader.AddGopathPath(path)
	} else {
		panic(fmt.Sprintf("AddGopathPath() not supported on custom loader of type %T", s.loader))
	}
}
674426
func (c *Context) ModuleURLPath(ppath string, args ...map[string]interface{}) string {
	return c.Application.URLBuilder.BuildFromPath(ppath, args...)
}
127065
func AppRootfsPath(root string, appName types.ACName) string {
	return filepath.Join(AppPath(root, appName), aci.RootfsDir)
}
746220
func (s *Service) ServiceConfigPath() (cfglib.Set, string) {
	return cfglib.ServiceSet(s.serviceID), svcconfig.ServiceConfigPath
}
448795
func NewFilePath(packagePath string) *File {
	return &File{
		Group: &Group{
			multi: true,
		},
		name:    guessAlias(packagePath),
		path:    packagePath,
		imports: map[string]importdef{},
		hints:   map[string]importdef{},
	}
}
192462
func SocketUnitPath(root string, appName types.ACName) string {
	return filepath.Join(common.Stage1RootfsPath(root), UnitsDir, SocketUnitName(appName))
}