-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cscli machines/bouncers: dry helper code and move to cscli (#3123)
- Loading branch information
Showing
3 changed files
with
81 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,25 @@ | ||
package ent | ||
|
||
import ( | ||
"strings" | ||
) | ||
|
||
func (m *Machine) GetOSNameAndVersion() string { | ||
ret := m.Osname | ||
if m.Osversion != "" { | ||
if ret != "" { | ||
ret += "/" | ||
} | ||
|
||
ret += m.Osversion | ||
} | ||
|
||
if ret == "" { | ||
return "?" | ||
} | ||
|
||
return ret | ||
func (m *Machine) GetOsname() string { | ||
return m.Osname | ||
} | ||
|
||
func (b *Bouncer) GetOSNameAndVersion() string { | ||
ret := b.Osname | ||
if b.Osversion != "" { | ||
if ret != "" { | ||
ret += "/" | ||
} | ||
|
||
ret += b.Osversion | ||
} | ||
|
||
if ret == "" { | ||
return "?" | ||
} | ||
|
||
return ret | ||
func (b *Bouncer) GetOsname() string { | ||
return b.Osname | ||
} | ||
|
||
func (m *Machine) GetFeatureFlagList() []string { | ||
if m.Featureflags == "" { | ||
return nil | ||
} | ||
func (m *Machine) GetOsversion() string { | ||
return m.Osversion | ||
} | ||
|
||
return strings.Split(m.Featureflags, ",") | ||
func (b *Bouncer) GetOsversion() string { | ||
return b.Osversion | ||
} | ||
|
||
func (b *Bouncer) GetFeatureFlagList() []string { | ||
if b.Featureflags == "" { | ||
return nil | ||
} | ||
func (m *Machine) GetFeatureflags() string { | ||
return m.Featureflags | ||
} | ||
|
||
return strings.Split(b.Featureflags, ",") | ||
func (b *Bouncer) GetFeatureflags() string { | ||
return b.Featureflags | ||
} |