Reuse RemoteDirect function for redfish dell client
Change-Id: I17726cae6f4d1f99e1cec4fa7a29c1a9e1dee3d5
This commit is contained in:
parent
a89666a36e
commit
0a5f1e2ca4
@ -275,8 +275,13 @@ func (c *Client) SystemPowerStatus(ctx context.Context) (power.Status, error) {
|
||||
|
||||
// RemoteDirect implements remote direct interface
|
||||
func (c *Client) RemoteDirect(ctx context.Context, isoURL string) error {
|
||||
return RemoteDirect(ctx, isoURL, c.redfishURL, c)
|
||||
}
|
||||
|
||||
// RemoteDirect allows to perform remotedirect
|
||||
func RemoteDirect(ctx context.Context, isoURL, redfishURL string, c ifc.Client) error {
|
||||
log.Debugf("Bootstrapping ephemeral host with ID '%s' and BMC Address '%s'.", c.NodeID(),
|
||||
c.redfishURL)
|
||||
redfishURL)
|
||||
|
||||
powerStatus, err := c.SystemPowerStatus(ctx)
|
||||
if err != nil {
|
||||
|
8
pkg/remote/redfish/vendors/dell/client.go
vendored
8
pkg/remote/redfish/vendors/dell/client.go
vendored
@ -53,6 +53,7 @@ const (
|
||||
type Client struct {
|
||||
username string
|
||||
password string
|
||||
redfishURL string
|
||||
redfish.Client
|
||||
RedfishAPI redfishAPI.RedfishAPI
|
||||
RedfishCFG *redfishClient.Configuration
|
||||
@ -127,6 +128,11 @@ func (c *Client) SetBootSourceByType(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemoteDirect implements remote direct interface
|
||||
func (c *Client) RemoteDirect(ctx context.Context, isoURL string) error {
|
||||
return redfish.RemoteDirect(ctx, isoURL, c.redfishURL, c)
|
||||
}
|
||||
|
||||
// newClient returns a client with the capability to make Redfish requests.
|
||||
func newClient(redfishURL string,
|
||||
insecure bool,
|
||||
@ -141,7 +147,7 @@ func newClient(redfishURL string,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c := &Client{username, password, *genericClient, genericClient.RedfishAPI, genericClient.RedfishCFG}
|
||||
c := &Client{username, password, redfishURL, *genericClient, genericClient.RedfishAPI, genericClient.RedfishCFG}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user