Update basis ResourceId to match interface
This commit is contained in:
parent
22de22e199
commit
a2147ed27f
@ -415,7 +415,7 @@ func (b *Basis) LoadProject(popts ...ProjectOption) (p *Project, err error) {
|
||||
p.Closer(func() error {
|
||||
b.m.Lock()
|
||||
defer b.m.Unlock()
|
||||
delete(b.projects, p.ResourceId())
|
||||
delete(b.projects, p.project.ResourceId)
|
||||
delete(b.projects, p.Name())
|
||||
return nil
|
||||
})
|
||||
@ -494,11 +494,11 @@ func (b *Basis) SaveFull() (err error) {
|
||||
for _, p := range b.projects {
|
||||
b.logger.Trace("saving project",
|
||||
"basis", b.ResourceId(),
|
||||
"project", p.ResourceId())
|
||||
"project", p.project.ResourceId)
|
||||
|
||||
if perr := p.SaveFull(); perr != nil {
|
||||
b.logger.Trace("error while saving project",
|
||||
"project", p.ResourceId(),
|
||||
"project", p.project.ResourceId,
|
||||
"error", err)
|
||||
|
||||
err = multierror.Append(err, perr)
|
||||
|
||||
@ -204,8 +204,8 @@ func (p *Project) Name() string {
|
||||
}
|
||||
|
||||
// Resource ID for this project
|
||||
func (p *Project) ResourceId() string {
|
||||
return p.project.ResourceId
|
||||
func (p *Project) ResourceId() (string, error) {
|
||||
return p.project.ResourceId, nil
|
||||
}
|
||||
|
||||
// Returns the job info if currently set
|
||||
@ -362,7 +362,7 @@ func (p *Project) Save() (err error) {
|
||||
defer p.m.Unlock()
|
||||
|
||||
p.logger.Trace("saving project to db",
|
||||
"project", p.ResourceId())
|
||||
"project", p.project.ResourceId)
|
||||
|
||||
result, err := p.Client().UpsertProject(p.ctx,
|
||||
&vagrant_server.UpsertProjectRequest{
|
||||
@ -371,7 +371,7 @@ func (p *Project) Save() (err error) {
|
||||
)
|
||||
if err != nil {
|
||||
p.logger.Trace("failed to save project",
|
||||
"project", p.ResourceId())
|
||||
"project", p.project.ResourceId)
|
||||
}
|
||||
|
||||
p.project = result.Project
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user