Skip to content

Commit 3875c7c

Browse files
committed
Fixing create protection profile name input logic
Filling Protection Profile name as same as protection container in case protection profile name is empty since it is n optional parameter.
1 parent 277c794 commit 3875c7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/StartAzureSiteRecoveryProtectionProfileAssociationJob.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ HyperVReplicaAzureProtectionProfileInput hyperVReplicaAzureProtectionProfileInpu
114114

115115
CreateProtectionProfileInput createProtectionProfileInput =
116116
new CreateProtectionProfileInput(
117-
this.ProtectionProfile.Name,
117+
string.IsNullOrEmpty(this.ProtectionProfile.Name) ? this.PrimaryProtectionContainer.Name : this.ProtectionProfile.Name,
118118
this.ProtectionProfile.ReplicationProvider,
119119
DataContractUtils<HyperVReplicaAzureProtectionProfileInput>.Serialize(hyperVReplicaAzureProtectionProfileInput));
120120

@@ -154,8 +154,8 @@ HyperVReplicaProtectionProfileInput hyperVReplicaProtectionProfileInput
154154
};
155155

156156
CreateProtectionProfileInput createProtectionProfileInput =
157-
new CreateProtectionProfileInput(
158-
this.ProtectionProfile.Name,
157+
new CreateProtectionProfileInput( // Name of the protection profile as the name of the protection container if not given
158+
string.IsNullOrEmpty(this.ProtectionProfile.Name) ? this.PrimaryProtectionContainer.Name : this.ProtectionProfile.Name,
159159
this.ProtectionProfile.ReplicationProvider,
160160
DataContractUtils<HyperVReplicaProtectionProfileInput>.Serialize(hyperVReplicaProtectionProfileInput));
161161

0 commit comments

Comments
 (0)