Skip to content

Commit

Permalink
Allow to use object manager for on-prem environments
Browse files Browse the repository at this point in the history
  • Loading branch information
dvob committed Jun 20, 2019
1 parent 7247dee commit f0c1661
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions object_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type ObjectManager struct {
connector IBConnector
cmpType string
tenantID string
// If OmitCloudAttrs is true no extra attributes for cloud are set
OmitCloudAttrs bool
}

func NewObjectManager(connector IBConnector, cmpType string, tenantID string) *ObjectManager {
Expand All @@ -59,11 +61,20 @@ func NewObjectManager(connector IBConnector, cmpType string, tenantID string) *O
return objMgr
}

func NewLocalObjectManager(connector IBConnector) *ObjectManager {
return &ObjectManager{
connector: connector,
OmitCloudAttrs: true,
}
}

func (objMgr *ObjectManager) getBasicEA(cloudAPIOwned Bool) EA {
ea := make(EA)
ea["Cloud API Owned"] = cloudAPIOwned
ea["CMP Type"] = objMgr.cmpType
ea["Tenant ID"] = objMgr.tenantID
if !objMgr.OmitCloudAttrs {
ea["Cloud API Owned"] = cloudAPIOwned
ea["CMP Type"] = objMgr.cmpType
ea["Tenant ID"] = objMgr.tenantID
}
return ea
}

Expand Down

0 comments on commit f0c1661

Please sign in to comment.