Set box id
This commit is contained in:
parent
085e30053e
commit
1545093be2
@ -65,6 +65,7 @@ func NewBox(opts ...BoxOption) (b *Box, err error) {
|
||||
return nil, err
|
||||
}
|
||||
mapstructure.Decode(metadata, &b.box.Metadata)
|
||||
b.box.Id = b.box.Name + "-" + b.box.Version + "-" + b.box.Provider
|
||||
b.Save()
|
||||
return
|
||||
}
|
||||
@ -338,6 +339,10 @@ func (b *Box) Compare(box core.Box) (int, error) {
|
||||
return 0, errors.New("Box name and provider does not match, can't compare")
|
||||
}
|
||||
|
||||
func (b *Box) ToProto() *vagrant_server.Box {
|
||||
return b.box
|
||||
}
|
||||
|
||||
func (b *Box) Save() error {
|
||||
b.m.Lock()
|
||||
defer b.m.Unlock()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user