We study an axisymmetric metric satisfying the Petrov type D property with some additional ansatze, but without assuming the vacuum condition. We find that our metric in turn becomes conformal to the Kerr metric deformed by one function of the radial coordinate. We then study the gravitational-wave equations on this background metric in the case that the conformal factor is unity. We find that under an appropriate gauge condition, the homogeneous wave equations admit the separation of the variables, which is also helpful for solving the nonhomo...